Files
snippetbox/cmd/web/routes.go
lbenedar 7a7042bc66 ch3.5
2026-03-04 15:21:35 +03:00

17 lines
384 B
Go

package main
import "net/http"
func (app *application) routes() *http.ServeMux {
mux := http.NewServeMux()
fileServer := http.FileServer(http.Dir("./ui/static/"))
mux.Handle("/static/", http.StripPrefix("/static", fileServer))
mux.HandleFunc("/", app.home)
mux.HandleFunc("/snippet/view", app.snippetView)
mux.HandleFunc("/snippet/create", app.snippetCreate)
return mux
}