Использовал новые группы
This commit is contained in:
parent
48a84eb03f
commit
87b4f197db
1 changed files with 5 additions and 3 deletions
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue