This commit is contained in:
lbenedar
2026-03-06 14:58:38 +03:00
parent 94345eff97
commit b6cdb2b860
9 changed files with 24 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ func (app *application) routes() http.Handler {
fileServer := http.FileServer(http.Dir("./ui/static/"))
router.Handler(http.MethodGet, "/static/*filepath", http.StripPrefix("/static", fileServer))
dynamic := alice.New(app.sessionManager.LoadAndSave)
dynamic := alice.New(app.sessionManager.LoadAndSave, noSurf)
router.Handler(http.MethodGet, "/", dynamic.ThenFunc(app.home))
router.Handler(http.MethodGet, "/snippet/view/:id", dynamic.ThenFunc(app.snippetView))