aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/cmd/serve.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/cmd/serve.go b/app/cmd/serve.go
index 4222580..f99adc2 100644
--- a/app/cmd/serve.go
+++ b/app/cmd/serve.go
@@ -88,9 +88,11 @@ func serve(ctx context.Context) error {
e.HandleFunc("POST /logout", r.Logout)
e.HandleFunc("GET /{$}", r.Index)
- e.HandleFunc("GET /t/{id}", r.Topic)
- e.HandleFunc("GET /t/new", r.NewTopic)
- e.HandleFunc("POST /t/new", r.NewTopic)
+ mux.Group(e, "/t", func(sm *http.ServeMux) {
+ sm.HandleFunc("GET /{id}", r.Topic)
+ sm.HandleFunc("GET /new", r.NewTopic)
+ sm.HandleFunc("POST /new", r.NewTopic)
+ })
e.HandleFunc("POST /p/new", r.NewPost)
e.Handle("/assets/", http.StripPrefix("/assets", http.FileServerFS(assets.FS)))