goshorly/main.go
Phil fce20e7c61
All checks were successful
ci/woodpecker/pr/0-pre Pipeline was successful
ci/woodpecker/pr/1-build-check Pipeline was successful
removed renderings to comments
2025-04-09 21:06:28 +02:00

38 lines
669 B
Go

package main
import (
"log"
"git.hackmi.ch/Phil/goshorly/db"
"git.hackmi.ch/Phil/goshorly/routes"
"git.hackmi.ch/Phil/goshorly/utils"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/limiter"
)
func main() {
utils.Print_Starting_Screen()
utils.Init_env_file()
utils.Init_env_vars()
utils.Init_build_vars()
db.Init_redis()
app := fiber.New(fiber.Config{
CaseSensitive: true,
})
app.Get("/", routes.Gethome)
if utils.ESTATS == "true" {
app.Get("/stats", routes.GetStats)
}
app.Get("/:id", routes.ID)
app.Use(limiter.New(utils.ConfigLimiter))
app.Post("/", routes.Posthome)
log.Fatal(app.Listen(":" + utils.PORT))
}