2024-02-17 13:25:03 +01:00
|
|
|
package routes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.gnous.eu/Rick/calendrier/controllers"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
func SetupApi(app *fiber.App) {
|
2024-02-24 16:01:08 +01:00
|
|
|
/*
|
|
|
|
api := app.Group("/api/v1", jwtware.New(jwtware.Config{
|
|
|
|
SigningKey: jwtware.SigningKey{Key: []byte(os.Getenv("JWT_SECRET"))},
|
|
|
|
}))
|
|
|
|
*/
|
|
|
|
|
2024-02-17 13:25:03 +01:00
|
|
|
api := app.Group("/api/v1")
|
|
|
|
|
|
|
|
api.Get("/calendars", controllers.GetCalendars)
|
|
|
|
api.Get("/calendar/:id<int>", controllers.GetCalendar)
|
|
|
|
|
|
|
|
api.Post("/calendar", controllers.PostCalendar)
|
|
|
|
|
2024-02-24 16:01:08 +01:00
|
|
|
api.Post("/user", controllers.CreateUser)
|
|
|
|
api.Post("/login", controllers.GetToken)
|
|
|
|
|
2024-02-17 13:25:03 +01:00
|
|
|
/*
|
|
|
|
api.Put("/calendar/:id<int>/visibility", controllers.PutVisibilityCalendar)
|
|
|
|
api.Delete("/calendar/:id<int>", controllers.DeleteCalendar)
|
|
|
|
|
|
|
|
api.Get("/calendar/:id<int>/events", controllers.GetCalendarEvents)
|
|
|
|
api.Post("/calendar/:id<int>/event/:id<int>", controllers.PostCalendarEvent)
|
|
|
|
|
|
|
|
api.Get("/event/:id<int>", controllers.GetEvent)
|
|
|
|
api.Post("/event/:id<int>", controllers.PostEvent)
|
|
|
|
api.Put("/event/:id<int>", controllers.PutEvent)
|
|
|
|
api.Delete("/event/:id<int>", controllers.DeleteEvent)
|
|
|
|
*/
|
|
|
|
}
|