ch13.1
This commit is contained in:
@@ -3,6 +3,8 @@ package main
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"gitea.local.lab/Lbenedar/snippetbox/ui"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
"github.com/justinas/alice"
|
||||
)
|
||||
@@ -14,8 +16,8 @@ func (app *application) routes() http.Handler {
|
||||
app.notFound(w)
|
||||
})
|
||||
|
||||
fileServer := http.FileServer(http.Dir("./ui/static/"))
|
||||
router.Handler(http.MethodGet, "/static/*filepath", http.StripPrefix("/static", fileServer))
|
||||
fileServer := http.FileServer(http.FS(ui.Files))
|
||||
router.Handler(http.MethodGet, "/static/*filepath", fileServer)
|
||||
|
||||
dynamic := alice.New(app.sessionManager.LoadAndSave, noSurf, app.authenticate)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user