18 lines
418 B
Plaintext
18 lines
418 B
Plaintext
{
|
|
(* get the request info *)
|
|
argv shatter
|
|
|
|
(* if its a get request we want to ignore the request body *)
|
|
"GET" streq?
|
|
{ pop } ifyes
|
|
|
|
(* check to see if we have the root route, if so return index.html *)
|
|
dup "/" streq?
|
|
choose
|
|
{ exch pop "index.html" exch } ifyes
|
|
{ "." exch strtie } ifno
|
|
|
|
(* now read the requested file and return it *)
|
|
readall disp
|
|
} ":3333" servehttp
|