Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Issue #17 Use "request" data for default app_url
  • Loading branch information
polarlights committed Nov 23, 2015
commit ea6795ced75e4cf9d604f36a991f0ec447b83c46
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ Create an initializer (e.g. `./config/initializers/swagger.rb`) and specify the
```ruby
GrapeSwaggerRails.options.url = '/swagger_doc.json'
GrapeSwaggerRails.options.app_url = 'http://swagger.wordnik.com'
``````

If you want to set the default app_url according to the request automatically, add code below to `./config/initializers/swagger.rb`:

```ruby
GrapeSwaggerRails.options.before_filter_proc = proc { GrapeSwaggerRails.options.app_url = request.protocol + request.host_with_port }
```

You can set the app name, default is "Swagger".
Expand Down