nicer Eiffel code, let's not try to achieve everything-in-one-line style ...
This commit is contained in:
@@ -15,13 +15,14 @@ feature {NONE} -- Initialization
|
||||
make
|
||||
do
|
||||
print ("Example: start a Nino web server on port " + port_number.out + ", %Nand reply Hello World for any request such as http://localhost:8123/%N")
|
||||
(create {GW_NINO_APPLICATION}.make (agent (req: GW_REQUEST; res: GW_RESPONSE)
|
||||
(create {GW_NINO_APPLICATION}.make_custom (agent execute, "")).listen (port_number)
|
||||
end
|
||||
|
||||
execute (req: GW_REQUEST; res: GW_RESPONSE)
|
||||
do
|
||||
res.output.put_header (200, <<["Content-Type", "text/plain"]>>)
|
||||
res.output.put_string ("Hello World!%N")
|
||||
end
|
||||
)).listen (port_number)
|
||||
end
|
||||
|
||||
port_number: INTEGER = 8123
|
||||
|
||||
|
||||
Reference in New Issue
Block a user