File tree 3 files changed +11
-2
lines changed
3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ class SwaggerDocs
40
40
end
41
41
42
42
server do
43
- key :url , ( Rails . env . development? ? 'http://localhost:3000' : 'https://api.rails.boilerplate' ) . to_s
43
+ url_options = Rails . application . routes . default_url_options
44
+ key :url , "#{ url_options [ :protocol ] } ://#{ url_options [ :host ] } "
44
45
key :description , 'Rails API Boilerplate'
45
46
end
46
47
end
Original file line number Diff line number Diff line change 6
6
gem install foreman
7
7
fi
8
8
9
- foreman start -f Procfile.dev " $@ "
9
+ foreman start -p 3000 - f Procfile.dev " $@ "
Original file line number Diff line number Diff line change 2
2
3
3
require 'active_support/core_ext/integer/time'
4
4
5
+ APP_HOST = "lvh.me:#{ ENV . fetch ( 'PORT' , 3000 ) } " . freeze
6
+ URL_PROTOCOL = ENV [ 'URL_PROTOCOL' ] || 'http'
7
+
8
+ Rails . application . routes . default_url_options [ :host ] = APP_HOST
9
+ Rails . application . routes . default_url_options [ :protocol ] = URL_PROTOCOL
10
+
5
11
Rails . application . configure do
6
12
# Settings specified here will take precedence over those in config/application.rb.
7
13
14
+ config . hosts << '.lvh.me'
15
+
8
16
# In the development environment your application's code is reloaded any time
9
17
# it changes. This slows down response time but is perfect for development
10
18
# since you don't have to restart the web server when you make code changes.
You can’t perform that action at this time.
0 commit comments