Now can alternatively generate a static page for a URL from pages, or dynamically return it with c.Render from views. Did this for games and streams.
This commit is contained in:
parent
cb537328ff
commit
d095bc9ff4
6 changed files with 45 additions and 94 deletions
|
@ -22,6 +22,14 @@ func GetApiLogout(c *fiber.Ctx) error {
|
|||
return c.Redirect("/")
|
||||
}
|
||||
|
||||
func GetPageStream(c *fiber.Ctx) error {
|
||||
return c.Render("stream", fiber.Map{})
|
||||
}
|
||||
|
||||
func GetPageGame(c *fiber.Ctx) error {
|
||||
return c.Render("game", fiber.Map{})
|
||||
}
|
||||
|
||||
func GetApiStream(c *fiber.Ctx) error {
|
||||
sql, args, err := sq.Select("*").From("stream").ToSql()
|
||||
err = data.SelectJson[data.Stream](c, err, sql, args...)
|
||||
|
@ -118,6 +126,8 @@ func Setup(app *fiber.App) {
|
|||
CacheDuration: 1 * time.Nanosecond,
|
||||
})
|
||||
|
||||
app.Get("/stream/:id/", GetPageStream)
|
||||
app.Get("/game/:id/:name/", GetPageGame)
|
||||
app.Get("/api/stream", GetApiStream)
|
||||
app.Get("/api/logout", GetApiLogout)
|
||||
app.Get("/api/stream/:id", GetApiStreamId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue