From 87b4f197dba4f1d8f938fca41089777adada7e97 Mon Sep 17 00:00:00 2001 From: Alexander NeonXP Kiryukhin Date: Tue, 30 Jul 2024 01:16:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BB=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20?= =?UTF-8?q?=D0=B3=D1=80=D1=83=D0=BF=D0=BF=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/cmd/serve.go | 8 +++++--- 1 file 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)))