This commit is contained in:
lbenedar
2026-03-04 15:21:35 +03:00
parent 98683f382a
commit 7a7042bc66
2 changed files with 17 additions and 9 deletions

View File

@@ -31,18 +31,10 @@ func main() {
infoLog: infoLog,
}
mux := http.NewServeMux()
fileServer := http.FileServer(http.Dir("./ui/static/"))
mux.HandleFunc("/", app.home)
mux.HandleFunc("/snippet/view", app.snippetView)
mux.HandleFunc("/snippet/create", app.snippetCreate)
mux.Handle("/static/", http.StripPrefix("/static", fileServer))
srv := &http.Server{
Addr: cfg.addr,
ErrorLog: errorLog,
Handler: mux,
Handler: app.routes(),
}
infoLog.Printf("Starting server on %s", cfg.addr)