2025-12-16 16:37:53 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
|
|
|
"github.com/go-chi/render"
|
|
|
|
|
|
|
|
|
|
"github.com/Gleipnir-Technology/nidus-sync/auth"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func AddRoutes(r chi.Router) {
|
|
|
|
|
// Authenticated endpoints
|
|
|
|
|
r.Use(render.SetContentType(render.ContentTypeJSON))
|
|
|
|
|
r.Method("GET", "/mosquito-source", auth.NewEnsureAuth(apiMosquitoSource))
|
|
|
|
|
r.Method("GET", "/service-request", auth.NewEnsureAuth(apiServiceRequest))
|
|
|
|
|
r.Method("GET", "/trap-data", auth.NewEnsureAuth(apiTrapData))
|
2026-01-02 08:58:57 -07:00
|
|
|
r.Method("GET", "/client/ios", auth.NewEnsureAuth(handleClientIos))
|
2025-12-16 16:37:53 +00:00
|
|
|
r.Method("POST", "/audio/{uuid}", auth.NewEnsureAuth(apiAudioPost))
|
|
|
|
|
r.Method("POST", "/audio/{uuid}/content", auth.NewEnsureAuth(apiAudioContentPost))
|
|
|
|
|
r.Method("POST", "/image/{uuid}", auth.NewEnsureAuth(apiImagePost))
|
|
|
|
|
r.Method("POST", "/image/{uuid}/content", auth.NewEnsureAuth(apiImageContentPost))
|
|
|
|
|
|
|
|
|
|
// Unauthenticated endpoints
|
2026-01-15 22:56:32 +00:00
|
|
|
r.Get("/district", apiGetDistrict)
|
2026-01-24 19:13:55 +00:00
|
|
|
r.Get("/district/{slug}/logo", apiGetDistrictLogo)
|
2026-01-25 19:36:56 +00:00
|
|
|
r.Post("/signin", postSignin)
|
2026-01-21 03:30:03 +00:00
|
|
|
r.Post("/twilio/message", twilioMessagePost)
|
|
|
|
|
r.Post("/twilio/status", twilioStatusPost)
|
|
|
|
|
r.Post("/twilio/text", twilioTextPost)
|
2025-12-16 16:37:53 +00:00
|
|
|
r.Get("/webhook/fieldseeker", webhookFieldseeker)
|
|
|
|
|
r.Post("/webhook/fieldseeker", webhookFieldseeker)
|
|
|
|
|
}
|