Использовал новые группы

This commit is contained in:
Alexander NeonXP Kiryukhin 2024-07-30 01:16:48 +03:00
parent 48a84eb03f
commit 87b4f197db
Signed by: NeonXP
GPG key ID: 35E33E1AB7776B39

View file

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