aboutsummaryrefslogtreecommitdiff
path: root/main.go
blob: 3a2aa0949d55ca6c807730214848ba48aed59d42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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")
}