forked from AbdelmalekIhdene/Taskall
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroutes.go
More file actions
13 lines (11 loc) · 710 Bytes
/
routes.go
File metadata and controls
13 lines (11 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
package main
import "github.com/gorilla/mux"
func (srv *server) Routes() {
handler := mux.NewRouter()
handler.HandleFunc("/", srv.LogRequest(srv.HandleStaticTemplate("static/login.html"))).Methods("GET")
handler.HandleFunc("/organisation", srv.LogRequest(srv.HandleStaticTemplate("static/organisation.html"))).Methods("GET")
handler.HandleFunc("/dashboard", srv.LogRequest(srv.HandleStaticTemplate("static/dashboard.html"))).Methods("GET")
handler.HandleFunc("/scripts/{filename}", srv.LogRequest(srv.ServeDirectory("static/scripts"))).Methods("GET")
handler.HandleFunc("/stylesheets/{filename}", srv.LogRequest(srv.ServeDirectory("static/stylesheets"))).Methods("GET")
srv.Server.Handler = handler
}