add frontend auth middleware, embed user data in frontend html
This commit is contained in:
parent
d8cb8c8fa8
commit
0fa769a248
12 changed files with 265 additions and 42 deletions
|
@ -22,9 +22,13 @@ func Routes(app *app.App) {
|
|||
// also assets
|
||||
app.Router.Group(func(r chi.Router) {
|
||||
frontend := frontend.New(app)
|
||||
r.Use(app.FrontendAuth)
|
||||
|
||||
r.HandleFunc(frontend.AssetsPath(), frontend.ServeAssets)
|
||||
r.HandleFunc("/static/*", frontend.ServeStaticAssets)
|
||||
r.HandleFunc("/web", frontend.ServeFrontend)
|
||||
r.HandleFunc("/web/*", frontend.ServeFrontend)
|
||||
r.HandleFunc("/web/@{username}", frontend.ServeUser)
|
||||
r.HandleFunc("/web/@{username}/posts/{postID}", frontend.ServeStatus)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue