aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander NeonXP Kiryukhin <i@neonxp.ru>2024-07-30 01:16:48 +0300
committerAlexander NeonXP Kiryukhin <i@neonxp.ru>2024-07-30 01:16:48 +0300
commit87b4f197dba4f1d8f938fca41089777adada7e97 (patch)
treeed3da3b93fbabf45198ada84f2cef768bc8d7584
parent48a84eb03f6b17ee41d6f097c78d89488ba14e8c (diff)
Использовал новые группыHEADmaster
-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)))