ncodingapi/main.go

30 lines
603 B
Go

package main
import (
"api/routes"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
)
func main() {
app := fiber.New(fiber.Config{
StrictRouting: false,
DisableStartupMessage: true,
})
app.Use(cors.New(cors.Config{
AllowHeaders: "Origin,Content-Type,Accept,Content-Length,Accept-Language,Accept-Encoding,Connection,Access-Control-Allow-Origin",
AllowOrigins: "*",
AllowCredentials: true,
AllowMethods: "GET,POST,HEAD,PUT,DELETE,PATCH,OPTIONS",
}))
routes.Setup(app)
if err := app.Listen(":3800"); err != nil {
panic(err)
}
}