feat: support CORS by using rest.WithCors(...) (#1212)

* feat: support CORS by using rest.WithCors(...)

* chore: add comments

* refactor: lowercase unexported methods

* ci: fix lint errors
This commit is contained in:
Kevin Wan
2021-11-07 22:42:40 +08:00
committed by GitHub
parent e8efcef108
commit c28e01fed3
9 changed files with 238 additions and 145 deletions

View File

@@ -27,12 +27,12 @@ import (
{{.importPackages}}
)
func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
{{.routesAdditions}}
}
`
routesAdditionTemplate = `
engine.AddRoutes(
server.AddRoutes(
{{.routes}} {{.jwt}}{{.signature}} {{.prefix}}
)
`