18 lines
436 B
Go
18 lines
436 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))
|
||
|
|
||
|
// TODO: add more handlers
|
||
|
mux.HandleFunc("/", app.home)
|
||
|
mux.HandleFunc("/webmasters/view", app.webmasterView)
|
||
|
mux.HandleFunc("/sites/view", app.siteEntryView)
|
||
|
|
||
|
return mux
|
||
|
}
|