20 lines
530 B
Go
20 lines
530 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)
|
|
mux.HandleFunc("/next", app.nextSiteEntry)
|
|
mux.HandleFunc("/prev", app.prevSiteEntry)
|
|
|
|
return mux
|
|
}
|