diff --git a/api/handlers.go b/api/handlers.go index b2020a4..6b97a64 100644 --- a/api/handlers.go +++ b/api/handlers.go @@ -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) diff --git a/main.go b/main.go index e81be06..1481d58 100644 --- a/main.go +++ b/main.go @@ -9,8 +9,8 @@ import ( "github.com/gofiber/fiber/v2/middleware/logger" "github.com/gofiber/template/html/v2" - _ "github.com/mattn/go-sqlite3" - recov "github.com/gofiber/fiber/v2/middleware/recover" + _ "github.com/mattn/go-sqlite3" + recov "github.com/gofiber/fiber/v2/middleware/recover" "zedshaw.games/webapp/api" "zedshaw.games/webapp/data" diff --git a/public/stream/1/index.html b/public/stream/1/index.html deleted file mode 100644 index bf3e0be..0000000 --- a/public/stream/1/index.html +++ /dev/null @@ -1,89 +0,0 @@ - - -
- - - - - - -Qui animated corpse, cricket bat max brucks terribilem incessu zomby. The voodoo sacerdos flesh eater, suscitat mortuos comedere carnem virus. Zonbi tattered for solum oculi eorum defunctis go lum cerebro. Nescio brains an Undead zombies. Sicut malus putrid voodoo horror.
-