diff options
Diffstat (limited to 'pkg/webui/routes.go')
-rw-r--r-- | pkg/webui/routes.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/webui/routes.go b/pkg/webui/routes.go index ef16040..5cf31c0 100644 --- a/pkg/webui/routes.go +++ b/pkg/webui/routes.go @@ -10,5 +10,11 @@ func addRoutes( mux *http.ServeMux, db *database.DB, ) { + session := sessionsMiddleware(db) + requireLogin := loginMiddleware(db) mux.Handle("GET /healthz", handleHealthz()) + mux.Handle("GET /login", session(handleLoginGET())) + mux.Handle("POST /login", session(handleLoginPOST(db))) + mux.Handle("GET /static/", cache(http.FileServer(http.FS(staticFS)))) + mux.Handle("GET /", session(requireLogin(handleIndexGET()))) } |