varaq-interpreter-go/examples/webassembly-example/server.vqe

18 lines
418 B
Plaintext
Raw Permalink Normal View History

2024-07-12 00:30:26 -04:00
{
2024-07-12 22:15:00 -04:00
(* get the request info *)
argv shatter
(* if its a get request we want to ignore the request body *)
"GET" streq?
{ pop } ifyes
2024-07-12 22:15:00 -04:00
(* 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
2024-07-12 00:30:26 -04:00
} ":3333" servehttp