mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2026-05-24 20:26:18 +02:00
docs: add swagger auto generator
* to generate docs, run `make docs` * endpoint /swagger/
This commit is contained in:
@@ -5,11 +5,13 @@ import (
|
||||
|
||||
"github.com/VictoriaMetrics/metrics"
|
||||
"github.com/go-playground/validator/v10"
|
||||
_ "github.com/grassrootseconomics/cic-custodial/docs"
|
||||
"github.com/grassrootseconomics/cic-custodial/internal/api"
|
||||
"github.com/grassrootseconomics/cic-custodial/internal/custodial"
|
||||
"github.com/grassrootseconomics/cic-custodial/pkg/util"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
echoSwagger "github.com/swaggo/echo-swagger"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -39,6 +41,10 @@ func initApiServer(custodialContainer *custodial.Custodial) *echo.Echo {
|
||||
})
|
||||
}
|
||||
|
||||
if ko.Bool("service.docs") {
|
||||
server.GET("/docs/*", echoSwagger.WrapHandler)
|
||||
}
|
||||
|
||||
apiRoute := server.Group("/api", systemGlobalLock(custodialContainer))
|
||||
|
||||
apiRoute.POST("/account/create", api.HandleAccountCreate(custodialContainer))
|
||||
|
||||
Reference in New Issue
Block a user