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