This commit is contained in:
lbenedar
2026-03-05 13:24:54 +03:00
parent be06d0a5ca
commit 7ab49c9fc8
3 changed files with 11 additions and 2 deletions

View File

@@ -1,6 +1,10 @@
package main
import "net/http"
import (
"net/http"
"github.com/justinas/alice"
)
func (app *application) routes() http.Handler {
mux := http.NewServeMux()
@@ -12,5 +16,7 @@ func (app *application) routes() http.Handler {
mux.HandleFunc("/snippet/view", app.snippetView)
mux.HandleFunc("/snippet/create", app.snippetCreate)
return app.recoverPanic(app.logRequest(secureHeaders(mux)))
standard := alice.New(app.recoverPanic, app.logRequest, secureHeaders)
return standard.Then(mux)
}