|
|
|
@ -81,11 +81,11 @@ func genRoutes(dir string, api *spec.ApiSpec, force bool) error {
|
|
|
|
|
}
|
|
|
|
|
var jwt string
|
|
|
|
|
if g.jwtEnabled {
|
|
|
|
|
jwt = fmt.Sprintf(", ngin.WithJwt(serverCtx.Config.%s.AccessSecret)", g.authName)
|
|
|
|
|
jwt = fmt.Sprintf(", rest.WithJwt(serverCtx.Config.%s.AccessSecret)", g.authName)
|
|
|
|
|
}
|
|
|
|
|
var signature string
|
|
|
|
|
if g.signatureEnabled {
|
|
|
|
|
signature = fmt.Sprintf(", ngin.WithSignature(serverCtx.Config.%s.Signature)", g.authName)
|
|
|
|
|
signature = fmt.Sprintf(", rest.WithSignature(serverCtx.Config.%s.Signature)", g.authName)
|
|
|
|
|
}
|
|
|
|
|
if err := gt.Execute(&builder, map[string]string{
|
|
|
|
|
"routes": strings.TrimSpace(gbuilder.String()),
|
|
|
|
|