-
Notifications
You must be signed in to change notification settings - Fork 43
跨域中间件
YoyoFx edited this page Aug 27, 2020
·
3 revisions
configuration := Abstractions.NewConfigurationBuilder().AddYamlFile("config").Build()
YoyoGo.NewWebHostBuilder().
UseConfiguration(configuration).
Configure(func(app *YoyoGo.WebApplicationBuilder) {
app.UseMiddleware(Middleware.NewCORS())
}).
//......
//......
application.server.cors :
application:
server:
cors:
enable: true
allow_origins: [ "*" ]
allow_methods: [ "POST","GET","PUT", "PATCH" ]
allow_credentials: true