Skip to content

Commit 8d0183e

Browse files
committed
add option to submit own application name instead of default /swagger/
1 parent 3d3a824 commit 8d0183e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ Or install it yourself as:
2323
Create `./config/initializer/swagger.rb` with lines:
2424

2525
GrapeSwaggerRails.discoveryUrl = "/swagger_doc.json"
26+
GrapeSwaggerRails.appName = 'Swagger'
27+
GrapeSwaggerRails.appUrl = 'http://swagger.wordnik.com'
28+
2629

2730
## Нюансы
2831

app/views/grape_swagger_rails/application/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<body>
4141
<div id='header'>
4242
<div class="swagger-ui-wrap">
43-
<a id="logo" href="http://swagger.wordnik.com">swagger</a>
43+
<a id="logo" href="<%= GrapeSwaggerRails.appUrl %>"><%= GrapeSwaggerRails.appName %></a>
4444

4545
<form id='api_selector'>
4646

lib/grape-swagger-rails.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ module GrapeSwaggerRails
44
mattr_accessor :discoveryUrl, :apiKey, :headers
55

66
self.discoveryUrl = '/swagger_doc.json'
7-
self.apiKey = 'special-key'
8-
self.headers = {}
9-
7+
self.apiKey = 'special-key'
8+
self.headers = {}
9+
self.appName = 'Swagger'
10+
self.appUrl = 'http://swagger.wordnik.com'
1011
end
1112

0 commit comments

Comments
 (0)