calendrier/routes/api.go
2024-02-24 16:01:08 +01:00

37 lines
1 KiB
Go

package routes
import (
"git.gnous.eu/Rick/calendrier/controllers"
"github.com/gofiber/fiber/v2"
)
func SetupApi(app *fiber.App) {
/*
api := app.Group("/api/v1", jwtware.New(jwtware.Config{
SigningKey: jwtware.SigningKey{Key: []byte(os.Getenv("JWT_SECRET"))},
}))
*/
api := app.Group("/api/v1")
api.Get("/calendars", controllers.GetCalendars)
api.Get("/calendar/:id<int>", controllers.GetCalendar)
api.Post("/calendar", controllers.PostCalendar)
api.Post("/user", controllers.CreateUser)
api.Post("/login", controllers.GetToken)
/*
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)
*/
}