Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -4,12 +4,23 @@ import ( "log" "github.com/gofiber/fiber/v2" + "github.com/gofiber/template/html/v2" ) func main() { - app := fiber.New() + engine := html.New("./views", ".html") - app.Static("/", "./public") + app := fiber.New(fiber.Config{ + Views: engine, + }) + + app.Get("/", func(c *fiber.Ctx) error { + return c.Render("index", fiber.Map{ + "Title": "Демо-материал после демон-аэропорта", + }) + }) + + app.Static("/", "./static") log.Fatal(app.Listen(":3000")) } |