ResumeLens/internal/api/routes.go
Hayden Hargreaves 5500449334 feat: docker and nginx
Working on deployments
2026-03-31 12:40:57 -07:00

26 lines
829 B
Go

package api
import (
"github.com/go-chi/chi/v5"
"git.gophernest.net/azpect/ResumeLens/internal/handlers"
)
// Mount registers all API routes onto the provided router.
// Trace: SDD_LLD_0005 - Provide HTTP handler and endpoint for form data uploads
// Trace: SDD_LLD_0011 - Enforce per-IP rate limit (10/hr) at middleware level
func Mount(r chi.Router) {
r.Use(CORS)
r.Route("/api", func(r chi.Router) {
// Apply rate limiting to all API endpoints
// Trace: SRD_FuncReq_0014 - Prevent more than 10 resume gradings per hour
// Trace: SRD_SecReq_0004 - Implement rate limit of 10 requests per hour
// Trace: SDD_LLD_0011 - Rate limiting implemented at middleware level
r.Use(RateLimit)
// Trace: SDD_LLD_0005 - HTTP endpoint that accepts multipart/form data uploads
r.Post("/analyze", handlers.Analyze)
})
}