-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.go
16 lines (14 loc) · 1.05 KB
/
routes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package main
import "github.com/gorilla/mux"
func (srv *server) Routes() {
handler := mux.NewRouter()
handler.HandleFunc("/", srv.LogRequest(srv.HandleStaticTemplate("static/index.html"))).Methods("GET")
handler.HandleFunc("/selection", srv.LogRequest(srv.HandleSelectionTemplate("static/selection.html"))).Methods("GET")
handler.HandleFunc("/motorcycle", srv.LogRequest(srv.HandleMotorcycleTemplate("static/motorcycle.html"))).Methods("GET")
handler.HandleFunc("/scripts/{filename}", srv.LogRequest(srv.ServeDirectory("static/scripts"))).Methods("GET")
handler.HandleFunc("/components/{filename}", srv.LogRequest(srv.ServeDirectory("static/components"))).Methods("GET")
handler.HandleFunc("/stylesheets/{filename}", srv.LogRequest(srv.ServeDirectory("static/stylesheets"))).Methods("GET")
handler.HandleFunc("/images/hero/{filename}", srv.LogRequest(srv.ServeDirectory("static/images/hero"))).Methods("GET")
handler.HandleFunc("/images/sideview/{filename}", srv.LogRequest(srv.ServeDirectory("static/images/sideview"))).Methods("GET")
srv.Server.Handler = handler
}