add host option
This commit is contained in:
parent
00271c1cee
commit
37053c812b
2 changed files with 8 additions and 0 deletions
|
@ -163,6 +163,7 @@ module Middleman
|
||||||
def start_server(options={})
|
def start_server(options={})
|
||||||
opts = {
|
opts = {
|
||||||
:Port => options[:port] || 4567,
|
:Port => options[:port] || 4567,
|
||||||
|
:Host => options[:host] || "0.0.0.0",
|
||||||
:AccessLog => []
|
:AccessLog => []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,12 @@ module Middleman
|
||||||
:aliases => "-e",
|
:aliases => "-e",
|
||||||
:default => ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
|
:default => ENV['MM_ENV'] || ENV['RACK_ENV'] || 'development',
|
||||||
:desc => "The environment Middleman will run under"
|
:desc => "The environment Middleman will run under"
|
||||||
|
method_option :host,
|
||||||
|
:type => :string,
|
||||||
|
:aliases => "-h",
|
||||||
|
# :required => true,
|
||||||
|
:default => "0.0.0.0",
|
||||||
|
:desc => "Bind to HOST address"
|
||||||
method_option "port",
|
method_option "port",
|
||||||
:aliases => "-p",
|
:aliases => "-p",
|
||||||
:default => "4567",
|
:default => "4567",
|
||||||
|
@ -64,6 +70,7 @@ module Middleman
|
||||||
def server
|
def server
|
||||||
params = {
|
params = {
|
||||||
:port => options["port"],
|
:port => options["port"],
|
||||||
|
:host => options["host"],
|
||||||
:environment => options["environment"],
|
:environment => options["environment"],
|
||||||
:debug => options["debug"]
|
:debug => options["debug"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue