21 lines
352 B
Text
21 lines
352 B
Text
"#httpserver/base.spl" import
|
|
|
|
func main { exitcode | with args ;
|
|
def server
|
|
net:http:Server:new<"::0" 4000> =server
|
|
"Started listening on ::0:4000" println
|
|
"ip a:" println
|
|
|
|
[ "ip" "a" ] command-wait;
|
|
|
|
while { 1 } {
|
|
server:accept
|
|
dup :read
|
|
dup :path println
|
|
dup :body _str println
|
|
:write-ok:write-str-body<"">:finish;
|
|
|
|
}
|
|
|
|
0
|
|
}
|