Files
golearn/snippetbox/cmd/web/routes.go
2023-08-06 21:02:11 +00:00

14 lines
381 B
Go

package main
import "net/http"
func (app *application) routes() *http.ServerMux {
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
}