aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
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")
+}