Simple test of having a render handler that simply renders files by URL name.

This commit is contained in:
Zed A. Shaw 2025-06-24 14:46:05 -04:00
parent 0bccddc62c
commit db58b38917
4 changed files with 19 additions and 13 deletions

View file

@ -29,9 +29,12 @@ func main() {
store := session.New()
engine := html.New("./views", ".html")
app := fiber.New(fiber.Config{
Views: engine,
ViewsLayout: "layouts/main",
})
app.Use(logger.New())
app.Use(recov.New())
@ -91,8 +94,8 @@ func main() {
app.Static("/", "./public")
app.Get("/test/", func (c *fiber.Ctx) error {
return c.Render("index", fiber.Map{
app.Get("/test/:name/", func (c *fiber.Ctx) error {
return c.Render(c.Params("name"), fiber.Map{
"Title": "Hello, World!",
})
})