"base.spl" import "_static_ext_server" net:http:server:register "_static_ext_Request" net:http:server:register construct net:http:server:_static_ext_server { cached-files ; get-cached-files { cached-files | with this ; this:cached-files dup not if { pop MicroMap:new dup this:=cached-files } } } construct net:http:server:_static_ext_Request { ; serve-file { this | with filepath path type this ; this:path path eq if { filepath read-file this:write-ok:write-content-type:write-str-body:finish; } this } serve-file-cached { this | with filepath path type this ; this:path path eq if { filepath this:server:get-cached-files:get dup not if { pop filepath read-file dup this:server:cached-files:set; } this:write-ok:write-content-type:write-str-body:finish; } this } serve-string { this | with string path type this ; this:path path eq if { string this:write-ok:write-content-type:write-str-body:finish; } this } serve-html { this | with this ; "text/html" this:serve-file } serve-html-cached { this | with this ; "text/html" this:serve-file-cached } serve-html-string { this | with this ; "text/html" this:serve-string } } include net:http:server:_static_ext_server in net:http:Server include net:http:server:_static_ext_Request in net:http:server:Request