add a bunch of frontend stuff
This commit is contained in:
parent
2586161abd
commit
bc85b7c340
30 changed files with 1459 additions and 136 deletions
|
@ -2,12 +2,23 @@ package web
|
|||
|
||||
import (
|
||||
"git.sleepycat.moe/sam/mercury/web/app"
|
||||
"git.sleepycat.moe/sam/mercury/web/auth"
|
||||
"git.sleepycat.moe/sam/mercury/web/frontend"
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
func Routes(app *app.App) {
|
||||
// auth
|
||||
app.Router.Route("/auth", func(r chi.Router) {
|
||||
auth := auth.New(app)
|
||||
r.Get("/login", auth.GetLogin)
|
||||
})
|
||||
|
||||
// web app handlers
|
||||
// also assets
|
||||
frontend := frontend.New(app)
|
||||
app.Router.HandleFunc(frontend.AssetsPath(), frontend.ServeAssets)
|
||||
app.Router.HandleFunc("/static/*", frontend.ServeStaticAssets)
|
||||
app.Router.HandleFunc("/web", frontend.ServeFrontend)
|
||||
app.Router.HandleFunc("/web/*", frontend.ServeFrontend)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue