Created
March 17, 2015 22:36
-
-
Save fabiosoft/3073f18dd9e92cebeabe to your computer and use it in GitHub Desktop.
Rails' built-in server binding default on 0.0.0.0 or different port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby2.2 | |
begin | |
load File.expand_path("../spring", __FILE__) | |
rescue LoadError | |
end | |
APP_PATH = File.expand_path('../../config/application', __FILE__) | |
require_relative '../config/boot' | |
# START NEW CODE | |
require "rails/commands/server" | |
module Rails | |
class Server | |
def default_options | |
super.merge({ | |
:Host => '0.0.0.0', | |
:Port => 3000, | |
:environment => (ENV['RAILS_ENV'] || "development").dup, | |
:daemonize => false, | |
:debugger => false, | |
:pid => File.expand_path("tmp/pids/server.pid"), | |
:config => File.expand_path("config.ru") | |
}) | |
end | |
end | |
end | |
# END NEW CODE | |
require 'rails/commands' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment