fix: end of line char
This commit is contained in:
82
app/main.go
82
app/main.go
@@ -1,41 +1,41 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
"github.com/gofiber/fiber/v2/middleware/helmet"
|
||||
"github.com/gofiber/fiber/v2/middleware/logger"
|
||||
|
||||
"cloud.etaviaporte.com/api/libs/services/auth"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := fiber.New()
|
||||
|
||||
app.Use(cors.New(cors.Config{
|
||||
AllowOrigins: "https://api.etaviaporte.com, http://127.0.0.1, http://localhost",
|
||||
AllowHeaders: "Origin, Content-Type, Accept, Authorization",
|
||||
AllowMethods: "GET, POST, HEAD, PUT, DELETE, PATCH",
|
||||
AllowCredentials: true,
|
||||
}))
|
||||
|
||||
app.Use(logger.New(logger.Config{
|
||||
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
|
||||
}))
|
||||
|
||||
app.Use(helmet.New())
|
||||
|
||||
app.Get("/", func(c *fiber.Ctx) error {
|
||||
return c.SendString("Hello, World!")
|
||||
})
|
||||
|
||||
handler := auth.Handler{}
|
||||
// openapi.RegisterHandlers(app, auth.Handler{})
|
||||
|
||||
app.Post("/auth/login", handler.PostAuthLogin)
|
||||
app.Post("/auth/logout", handler.PostAuthLogout)
|
||||
app.Get("/auth/me", handler.GetAuthMe)
|
||||
app.Post("/auth/refresh", handler.PostAuthRefresh)
|
||||
|
||||
app.Listen(":3000")
|
||||
}
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
"github.com/gofiber/fiber/v2/middleware/helmet"
|
||||
"github.com/gofiber/fiber/v2/middleware/logger"
|
||||
|
||||
"cloud.etaviaporte.com/api/libs/services/auth"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := fiber.New()
|
||||
|
||||
app.Use(cors.New(cors.Config{
|
||||
AllowOrigins: "https://api.etaviaporte.com, http://127.0.0.1, http://localhost",
|
||||
AllowHeaders: "Origin, Content-Type, Accept, Authorization",
|
||||
AllowMethods: "GET, POST, HEAD, PUT, DELETE, PATCH",
|
||||
AllowCredentials: true,
|
||||
}))
|
||||
|
||||
app.Use(logger.New(logger.Config{
|
||||
Format: "[${ip}]:${port} ${status} - ${method} ${path}\n",
|
||||
}))
|
||||
|
||||
app.Use(helmet.New())
|
||||
|
||||
app.Get("/", func(c *fiber.Ctx) error {
|
||||
return c.SendString("Hello, World!")
|
||||
})
|
||||
|
||||
handler := auth.Handler{}
|
||||
// openapi.RegisterHandlers(app, auth.Handler{})
|
||||
|
||||
app.Post("/auth/login", handler.PostAuthLogin)
|
||||
app.Post("/auth/logout", handler.PostAuthLogout)
|
||||
app.Get("/auth/me", handler.GetAuthMe)
|
||||
app.Post("/auth/refresh", handler.PostAuthRefresh)
|
||||
|
||||
app.Listen(":3000")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user