package main import ( "flag" "log" "git.odit.services/lfk/document-server/docs" // Correct import path for docs "git.odit.services/lfk/document-server/handlers" "github.com/gofiber/fiber/v2" "github.com/gofiber/swagger" ) var ( port = flag.String("port", ":3000", "Port to listen on") prod = flag.Bool("prod", false, "Enable prefork in Production") ) // @title LfK Document Server API // @description This is the API documentation for the LfK Document Server - a tool for pdf generation. func main() { // Parse command-line flags flag.Parse() // Create a new Fiber instance app := fiber.New(fiber.Config{ Prefork: *prod, }) // Swagger documentation route app.Get("/swagger/*", swagger.HandlerDefault) v1 := app.Group("/v1") v1.Get("/", func(c *fiber.Ctx) error { return c.SendString("Hello, World!") }) v1.Post("/contracts", handlers.GenerateContract) v1.Post("/cards", handlers.GenerateCard) v1.Post("/certificates", handlers.GenerateCertificate) app.Use(handlers.NotFoundHandler) docs.SwaggerInfo.BasePath = "/" log.Fatal(app.Listen(*port)) }