start setting up auth handler
This commit is contained in:
parent
82ac33ec66
commit
979a415b95
4 changed files with 62 additions and 0 deletions
|
|
@ -6,14 +6,21 @@ import (
|
|||
|
||||
"git.juancwu.dev/juancwu/budgething/assets"
|
||||
"git.juancwu.dev/juancwu/budgething/internal/app"
|
||||
"git.juancwu.dev/juancwu/budgething/internal/handler"
|
||||
"git.juancwu.dev/juancwu/budgething/internal/middleware"
|
||||
)
|
||||
|
||||
func SetupRoutes(a *app.App) http.Handler {
|
||||
auth := handler.NewAuthHandler()
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
// Static
|
||||
sub, _ := fs.Sub(assets.AssetsFS, ".")
|
||||
mux.Handle("GET /assets/", http.StripPrefix("/assets/", http.FileServer(http.FS(sub))))
|
||||
|
||||
// Auth pages
|
||||
mux.HandleFunc("GET /auth", middleware.RequireGuest(auth.AuthPage))
|
||||
|
||||
return mux
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue