Added a site picker plus options to create new sites
This commit is contained in:
parent
cc0da8d668
commit
d80aacc180
14 changed files with 203 additions and 29 deletions
|
|
@ -119,7 +119,17 @@ Starting weiro without any arguments will start the server.
|
|||
app.Post("/login", lh.DoLogin)
|
||||
app.Post("/logout", lh.Logout)
|
||||
|
||||
siteGroup := app.Group("/sites/:siteID", middleware.LogErrors(), middleware.RequireUser(svcs.Auth), middleware.RequiresSite(svcs.Sites))
|
||||
app.Get("/", middleware.OptionalUser(svcs.Auth), ih.Index)
|
||||
app.Get("/first-run", ih.FirstRun)
|
||||
app.Post("/first-run", ih.FirstRunSubmit)
|
||||
|
||||
app.Get("/static/*", static.New("./static"))
|
||||
|
||||
app.Use(middleware.LogErrors(), middleware.RequireUser(svcs.Auth))
|
||||
|
||||
app.Get("/sites/new", ssh.New)
|
||||
app.Post("/sites", ssh.Create)
|
||||
siteGroup := app.Group("/sites/:siteID", middleware.RequiresSite(svcs.Sites))
|
||||
|
||||
siteGroup.Get("/posts", ph.Index)
|
||||
siteGroup.Get("/posts/new", ph.New)
|
||||
|
|
@ -158,12 +168,6 @@ Starting weiro without any arguments will start the server.
|
|||
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)
|
||||
|
||||
app.Get("/static/*", static.New("./static"))
|
||||
|
||||
if err := app.Listen(":3000"); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue