Added support for server_name in nino, and openshift

This commit is contained in:
Jocelyn Fiat
2012-12-20 15:41:18 +01:00
parent b4c8c70360
commit 394ca05579
2 changed files with 16 additions and 1 deletions

View File

@@ -39,6 +39,9 @@ feature {NONE} -- Initialization
base_url := ""
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
port_number := l_port
elseif
@@ -89,6 +92,9 @@ feature -- Execution
", %Nand reply Hello World for any request such as http://localhost:" + port_number.out + "/" + base_url + "%N")
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.launch
end
@@ -98,6 +104,8 @@ feature {NONE} -- Implementation
port_number: INTEGER
server_name: detachable READABLE_STRING_8
base_url: READABLE_STRING_8
verbose: BOOLEAN

View File

@@ -38,6 +38,13 @@ feature {NONE} -- Initialization
do
Precursor
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 l_port.is_integer then
port_number := l_port.to_integer