diff --git a/SimpleServer/server.spl b/SimpleServer/server.spl index 6e38458..7b13cdf 100644 --- a/SimpleServer/server.spl +++ b/SimpleServer/server.spl @@ -3,6 +3,7 @@ "#httpserver/static.spl" import use net:http:Server +1048576 net:http:server:=bufsize construct Latest { release @@ -29,6 +30,15 @@ construct Object404 { } } +construct Refreshed { + ok + ; + construct { this | with this ; + "true" this:=ok + this properties props-to-json + } +} + func props-to-json { | with props ; "{" props @@ -65,6 +75,14 @@ func handle-client { | with client ; Latest:new client:write-ok:write-content-type<"application/json">:write-str-body:finish; } + "/refresh" client:path eq if { + "refresh" println; + client:server:cached-files if { + client:server:cached-files:clear; + } + Refreshed:new client:write-ok:write-content-type<"application/json">:write-str-body:finish; + } + client:wrote-body not if { Object404:new client:write-head<404 "Not Found">:write-content-type<"application/json">:write-str-body:finish; }