summaryrefslogblamecommitdiffstats
path: root/cmd/web/routes.go
blob: 58a351a23f2ae75d7499382af7e7ac8ff5dacac5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                       
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))

	mux.HandleFunc("/", app.home)
	mux.HandleFunc("/organisation/list", app.listOrganisations)
	mux.HandleFunc("/organisation/view", app.organisationView)
	mux.HandleFunc("/organisation/create", app.organisationCreate)
	mux.HandleFunc("/operation/list", app.listOperations)
	mux.HandleFunc("/person/list", app.listPersons)
	return mux
}