blob: d388364f621392ee50ba7a53e42666c3a75e128c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package main
import (
"log"
"log/slog"
"net/http"
"os"
)
type application struct {
logger *slog.Logger
}
func main() {
logger := slog.New(slog.NewTextHandler(os.Stdout, nil))
app := &application{
logger: logger,
}
// mux := http.NewServeMux()
// mux.HandleFunc("/", home)
// log.Print("starting server on :4000")
logger.Info("starting server on :4000")
err := http.ListenAndServe(":4000", app.routes())
log.Fatal(err)
}
|