Skip to content

Commit

Permalink
Add CORS setting to the swagger example
Browse files Browse the repository at this point in the history
  • Loading branch information
takezoe committed Nov 15, 2017
1 parent f75dd20 commit 015d5dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions 2.5/swagger-example/src/main/scala/ScalatraBootstrap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class ScalatraBootstrap extends LifeCycle {
implicit val swagger = new FlowersSwagger

override def init(context: ServletContext) {
context.initParameters("org.scalatra.cors.allowedOrigins") = "http://petstore.swagger.io"
context.mount(new FlowersController, "/flowers", "flowers")
context.mount (new ResourcesApp, "/api-docs")
}
Expand Down
1 change: 1 addition & 0 deletions 2.6/swagger-example/src/main/scala/ScalatraBootstrap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class ScalatraBootstrap extends LifeCycle {
implicit val swagger = new FlowersSwagger

override def init(context: ServletContext) {
context.initParameters("org.scalatra.cors.allowedOrigins") = "http://petstore.swagger.io"
context.mount(new FlowersController, "/flowers", "flowers")
context.mount (new ResourcesApp, "/api-docs")
}
Expand Down

0 comments on commit 015d5dd

Please sign in to comment.