aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorvulonkaaz <7442677+vulonkaaz@users.noreply.github.com>2024-06-19 17:44:29 +0200
committervulonkaaz <7442677+vulonkaaz@users.noreply.github.com>2024-06-19 17:44:29 +0200
commit2fe3b4972f02be8b0c6143325d541ddda4b91559 (patch)
tree5b430810b19e0c6b1112c601b9e64b9e9ec72c61 /main.go
Initial version
Diffstat (limited to 'main.go')
-rw-r--r--main.go30
1 files changed, 30 insertions, 0 deletions
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")
+}