Add skeleton for pages

This commit is contained in:
mudler
2024-04-07 20:29:33 +02:00
parent 00078b5da8
commit dda993e43b
3 changed files with 101 additions and 0 deletions

View File

@@ -123,6 +123,21 @@ func main() {
// Initialize a new Fiber app
webapp := fiber.New()
// Serve static files
webapp.Static("/", "./public")
webapp.Get("/", func(c fiber.Ctx) error {
return c.Render("index.html", fiber.Map{
"Title": "Hello, World!",
})
})
webapp.Get("/create", func(c fiber.Ctx) error {
return c.Render("create.html", fiber.Map{
"Title": "Hello, World!",
})
})
// Define a route for the GET method on the root path '/'
webapp.Get("/sse", func(c fiber.Ctx) error {
sseManager.Handle(c, NewClient(randStringRunes(10)))