mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 23:44:22 +00:00
Working swagger api docs
This commit is contained in:
@@ -11,6 +11,10 @@ import (
|
||||
"github.com/go-chi/cors"
|
||||
"github.com/go-chi/httprate"
|
||||
"github.com/unrolled/secure"
|
||||
|
||||
httpSwagger "github.com/swaggo/http-swagger"
|
||||
|
||||
_ "novamd/docs" // Swagger docs
|
||||
)
|
||||
|
||||
// setupRouter creates and configures the chi router with middleware and routes
|
||||
@@ -49,6 +53,12 @@ func setupRouter(o Options) *chi.Mux {
|
||||
Storage: o.Storage,
|
||||
}
|
||||
|
||||
if o.Config.IsDevelopment {
|
||||
r.Get("/swagger/*", httpSwagger.Handler(
|
||||
httpSwagger.URL("/swagger/doc.json"), // The URL pointing to API definition
|
||||
))
|
||||
}
|
||||
|
||||
// API routes
|
||||
r.Route("/api/v1", func(r chi.Router) {
|
||||
// Rate limiting for API routes
|
||||
|
||||
Reference in New Issue
Block a user