package main

import (
	"os"

	"github.com/gin-gonic/gin"
	"spahl.ddns.net/jasper/wok-able-backend/auth"
	"spahl.ddns.net/jasper/wok-able-backend/models"
	"spahl.ddns.net/jasper/wok-able-backend/server"
)

func main() {

	prodMode, isSet := os.LookupEnv("WOKABLE_MODE")
	if !isSet {
		prodMode = "debug"
	}

	if prodMode == "release" {
		models.ConnectDatabase()
	} else {
		models.ConnectDatabaseDev()
	}

	gin.SetMode(gin.ReleaseMode)

	models.SeedDatabase()
	auth.Setup()

	server.Setup(prodMode)

}
