feat(pages): add pages handler and admin routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Leon Mika 2026-03-22 18:03:06 +11:00
parent 1edcd7686c
commit f386403ced
2 changed files with 127 additions and 0 deletions

View file

@ -113,6 +113,7 @@ Starting weiro without any arguments will start the server.
uh := handlers.UploadsHandler{UploadsService: svcs.Uploads}
ssh := handlers.SiteSettingsHandler{SiteService: svcs.Sites}
ch := handlers.CategoriesHandler{CategoryService: svcs.Categories}
pgh := handlers.PagesHandler{PageService: svcs.Pages}
app.Get("/login", lh.Login)
app.Post("/login", lh.DoLogin)
@ -149,6 +150,14 @@ Starting weiro without any arguments will start the server.
siteGroup.Post("/categories/:categoryID", ch.Update)
siteGroup.Post("/categories/:categoryID/delete", ch.Delete)
siteGroup.Get("/pages", pgh.Index)
siteGroup.Get("/pages/new", pgh.New)
siteGroup.Get("/pages/:pageID", pgh.Edit)
siteGroup.Post("/pages", pgh.Create)
siteGroup.Post("/pages/reorder", pgh.Reorder)
siteGroup.Post("/pages/:pageID", pgh.Update)
siteGroup.Post("/pages/:pageID/delete", pgh.Delete)
app.Get("/", middleware.OptionalUser(svcs.Auth), ih.Index)
app.Get("/first-run", ih.FirstRun)
app.Post("/first-run", ih.FirstRunSubmit)