Add support for serving directly from filesystem

You can now pass `-D directory` to redbean which will serve assets from
the local filesystem. This is useful for development since it allows us
to skip needing to shut down the server and run InfoZIP when testing an
iteration of a lua server page script.

See #97
This commit is contained in:
Justine Tunney 2021-03-28 07:54:21 -07:00
parent a1677d605a
commit 3c19b6e352
7 changed files with 465 additions and 101 deletions

View file

@ -74,8 +74,8 @@ local function main()
Write([[
<h3>xmlhttprequest request demo</h3>
<input id="x" value="lâtìn1">
<label for="x">name</label><br>
<button id="send">send (via http header)</button><br>
<label for="x">X-Custom-Header</label><br>
<button id="send">send</button><br>
<div id="result"></div>
<script>
function OnSend() {
@ -90,6 +90,21 @@ local function main()
document.getElementById('send').onclick = OnSend;
</script>
]])
Write('<h3>extra information</h3>\n')
Write('<dt>GetClientAddr()\n')
Write('<dd>')
Write(GetClientAddr())
Write('\n')
Write('<dt>GetServerAddr()\n')
Write('<dd>')
Write(GetServerAddr())
Write('\n')
Write('<dt>FormatHttpDateTime(GetDate())\n')
Write('<dd>')
Write(FormatHttpDateTime(GetDate()))
Write('\n')
Write('</dl>\n')
end
main()