Added support for server_name in nino, and openshift
This commit is contained in:
@@ -39,6 +39,9 @@ feature {NONE} -- Initialization
|
|||||||
base_url := ""
|
base_url := ""
|
||||||
|
|
||||||
if attached options as opts then
|
if attached options as opts then
|
||||||
|
if attached {READABLE_STRING_GENERAL} opts.option ("server_name") as l_server_name then
|
||||||
|
server_name := l_server_name.to_string_8
|
||||||
|
end
|
||||||
if attached {INTEGER} opts.option ("port") as l_port then
|
if attached {INTEGER} opts.option ("port") as l_port then
|
||||||
port_number := l_port
|
port_number := l_port
|
||||||
elseif
|
elseif
|
||||||
@@ -89,6 +92,9 @@ feature -- Execution
|
|||||||
", %Nand reply Hello World for any request such as http://localhost:" + port_number.out + "/" + base_url + "%N")
|
", %Nand reply Hello World for any request such as http://localhost:" + port_number.out + "/" + base_url + "%N")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if attached server_name as l_server_name then
|
||||||
|
conn.configuration.set_http_server_name (l_server_name)
|
||||||
|
end
|
||||||
conn.configuration.http_server_port := port_number
|
conn.configuration.http_server_port := port_number
|
||||||
conn.launch
|
conn.launch
|
||||||
end
|
end
|
||||||
@@ -98,6 +104,8 @@ feature {NONE} -- Implementation
|
|||||||
|
|
||||||
port_number: INTEGER
|
port_number: INTEGER
|
||||||
|
|
||||||
|
server_name: detachable READABLE_STRING_8
|
||||||
|
|
||||||
base_url: READABLE_STRING_8
|
base_url: READABLE_STRING_8
|
||||||
|
|
||||||
verbose: BOOLEAN
|
verbose: BOOLEAN
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ feature {NONE} -- Initialization
|
|||||||
do
|
do
|
||||||
Precursor
|
Precursor
|
||||||
create l_env
|
create l_env
|
||||||
|
|
||||||
|
if attached l_env.get (Openshift_ip) as l_ip then
|
||||||
|
server_name := l_ip.to_string_8
|
||||||
|
else
|
||||||
|
die (Openshift_ip + " is not defined")
|
||||||
|
end
|
||||||
|
|
||||||
if attached l_env.get (Openshift_port) as l_port then
|
if attached l_env.get (Openshift_port) as l_port then
|
||||||
if l_port.is_integer then
|
if l_port.is_integer then
|
||||||
port_number := l_port.to_integer
|
port_number := l_port.to_integer
|
||||||
@@ -67,7 +74,7 @@ feature {NONE} -- Implementation
|
|||||||
|
|
||||||
Openshift_port: STRING = "OPENSHIFT_INTERNAL_PORT"
|
Openshift_port: STRING = "OPENSHIFT_INTERNAL_PORT"
|
||||||
-- OpenShift port environment variable name
|
-- OpenShift port environment variable name
|
||||||
|
|
||||||
|
|
||||||
;note
|
;note
|
||||||
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
|
||||||
|
|||||||
Reference in New Issue
Block a user