langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -0,0 +1,37 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref symbols binary
|
||||
|
||||
class RHelloWorldWebServer public
|
||||
|
||||
properties public constant
|
||||
isTrue = boolean (1 == 1)
|
||||
isFalse = boolean (1 \== 1)
|
||||
greeting1 = "Goodbye, World!"
|
||||
greeting2 = '' -
|
||||
|| 'HTTP/1.1 200 OK\r\n' -
|
||||
|| 'Content-Type: text/html; charset=UTF-8\r\n\r\n' -
|
||||
|| '<?xml version="1.0" encoding="UTF-8"?>\r\n' -
|
||||
|| '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r\n' -
|
||||
|| '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r\n' -
|
||||
|| '<header>\r\n' -
|
||||
|| '<title>Hello</title>\r\n' -
|
||||
|| '<style type="text/css">body {font-family: sans-serif;}</style>\r\n' -
|
||||
|| '</header>\r\n' -
|
||||
|| '<body>\r\n' -
|
||||
|| '<h2 style="text-align: center;">' || greeting1 || '</h2>\r\n' -
|
||||
|| '</body>\r\n' -
|
||||
|| '</html>\r\n' -
|
||||
|| ''
|
||||
|
||||
properties static inheritable
|
||||
terminate = isFalse -- TODO: provide a less draconian means to terminate the listener loop
|
||||
|
||||
method main(args = String[]) public static signals IOException
|
||||
listener = ServerSocket(8080)
|
||||
loop label listener forever
|
||||
if terminate then leave listener
|
||||
sock = listener.accept()
|
||||
PrintWriter(sock.getOutputStream(), isTrue).println(greeting2)
|
||||
sock.close()
|
||||
end listener
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue