From 2fe3b4972f02be8b0c6143325d541ddda4b91559 Mon Sep 17 00:00:00 2001 From: vulonkaaz <7442677+vulonkaaz@users.noreply.github.com> Date: Wed, 19 Jun 2024 17:44:29 +0200 Subject: Initial version --- main.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 main.go (limited to 'main.go') diff --git a/main.go b/main.go new file mode 100644 index 0000000..3a2aa09 --- /dev/null +++ b/main.go @@ -0,0 +1,30 @@ +package main + +import ( + "log" + "os" + "paperchan.club/database" + "paperchan.club/router" + "github.com/gofiber/fiber/v2" + "github.com/gofiber/template/html/v2" + "github.com/joho/godotenv" +) + +func main() { + err := godotenv.Load() + if err != nil { + log.Fatal(err) + } + database.DBConnect(os.Getenv("DBSTRING")) + + engine := html.New("./views", ".html") + + app := fiber.New(fiber.Config{ + Views: engine, + }) + + app.Static("/", "./static") + router.SetRoutes(app) + + app.Listen(":3000") +} -- cgit v1.2.3