Bind rails server to 127.0.0.1 by default -


i'd bind rails server 127.0.0.1, instead of 0.0.0.0 not accessible when i'm working coffee shops.

is there configuration file can specify option don't have pass command line switch:

rails server -b 127.0.0.1 

?

if searching rails 5: answer


in rails ~> 4.0 can customize boot section of server class:

in /config/boot.rb add lines:

require 'rails/commands/server'  module rails   class server     def default_options       super.merge({port: 10524, host: '127.0.0.1'})     end   end end 

as answered on questions:

how change rails 3 server default port in develoment?

how change default binding ip of rails 4.2 development server?


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -