1
0
Fork 0

Redundant /api

main v0.11.0
Jordan Hotmann 2023-11-17 12:16:40 -07:00
parent ffd1ff689b
commit 5473e80463
No known key found for this signature in database
GPG Key ID: 01B504170C2A2EA3
1 changed files with 9 additions and 9 deletions

View File

@ -61,20 +61,20 @@ func Listen(parentLogger *slog.Logger, readme []byte) {
router.Route("/api", func(r chi.Router) { router.Route("/api", func(r chi.Router) {
r.Use(tokenAuthMiddleware) r.Use(tokenAuthMiddleware)
r.Get(`/api/state/{entityId}`, getEntityStateHandler) r.Get(`/state/{entityId}`, getEntityStateHandler)
r.Post("/api/state/{entityId}/{service}", setEntityStateHandler) r.Post("/api/state/{entityId}/{service}", setEntityStateHandler)
r.Get("/api/timer/{timerName}", getTimerHandler) r.Get("/timer/{timerName}", getTimerHandler)
r.Post("/api/timer/{timerName}", startTimerHandler) r.Post("/timer/{timerName}", startTimerHandler)
r.Delete("/api/timer/{timerName}", deleteTimerHandler) r.Delete("/timer/{timerName}", deleteTimerHandler)
r.Get("/api/schedule/{scheduleName}", getScheduleHandler) r.Get("/schedule/{scheduleName}", getScheduleHandler)
r.Post("/api/schedule/{scheduleName}", createScheduleHandler) r.Post("/schedule/{scheduleName}", createScheduleHandler)
r.Delete("/api/schedule/{scheduleName}", deleteScheduleHandler) r.Delete("/schedule/{scheduleName}", deleteScheduleHandler)
r.Post("/api/ntfy", postNtfyHandler) r.Post("/ntfy", postNtfyHandler)
r.Post("/api/command/{commandName}", postCommandHandler) r.Post("/command/{commandName}", postCommandHandler)
}) })
server = http.Server{ server = http.Server{