mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
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:
parent
a1677d605a
commit
3c19b6e352
7 changed files with 465 additions and 101 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue