summaryrefslogtreecommitdiffstats
path: root/cmd/web/routes.go
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-04-18 11:06:32 +0100
committerMatthew Lemon <y@yulqen.org>2024-04-18 11:06:32 +0100
commit20560419614e22fbb58567cdb0b88b54caf679f4 (patch)
tree163df44f07907d865b363db3bc198287ebd3d25f /cmd/web/routes.go
parent435742cede199e3c85b5e2eb5a42ccbee4906a05 (diff)
Adds code from ded-go-core - no database
D2S test app code removed (nginx error). Adds all go code from `ded-go-core` using the basic Gov.UK UI for a test page for DED.
Diffstat (limited to 'cmd/web/routes.go')
-rw-r--r--cmd/web/routes.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmd/web/routes.go b/cmd/web/routes.go
new file mode 100644
index 0000000..58a351a
--- /dev/null
+++ b/cmd/web/routes.go
@@ -0,0 +1,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
+}