support cors in rest server

This commit is contained in:
kevin
2020-10-21 14:10:29 +08:00
parent 1c1e4bca86
commit fe0d0687f5
8 changed files with 122 additions and 8 deletions

View File

@@ -56,7 +56,7 @@ func main() {
Port: *port,
Timeout: *timeout,
MaxConns: 500,
})
}, rest.WithNotAllowedHandler(rest.CorsHandler()))
defer engine.Stop()
engine.Use(first)