25 lines
470 B
Go
25 lines
470 B
Go
package main
|
|
|
|
import (
|
|
"jwt_service/internal/database"
|
|
"jwt_service/internal/routes"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
"github.com/gofiber/fiber/v2/middleware/cors"
|
|
)
|
|
|
|
func main() {
|
|
database.DBconn()
|
|
|
|
app := fiber.New()
|
|
|
|
app.Use(cors.New(cors.Config{
|
|
AllowCredentials: true,
|
|
AllowOrigins: "http://127.0.0.1", //Very important while using a HTTPonly Cookie, frontend can easily get and return back the cookie.
|
|
}))
|
|
|
|
routes.Setup(app)
|
|
|
|
app.Listen(":8000")
|
|
}
|