mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Put redbean lua init demo code
This commit is contained in:
parent
2f56ebfe78
commit
cf3174dc74
1 changed files with 14 additions and 14 deletions
|
@ -20,17 +20,17 @@ db:exec[[
|
||||||
INSERT INTO test (content) VALUES ('Hello Sqlite3');
|
INSERT INTO test (content) VALUES ('Hello Sqlite3');
|
||||||
]]
|
]]
|
||||||
|
|
||||||
-- -- this intercepts all requests if it's defined
|
-- this intercepts all requests if it's defined
|
||||||
-- function OnHttpRequest()
|
function OnHttpRequest()
|
||||||
-- if HasParam('magic') then
|
if HasParam('magic') then
|
||||||
-- Write('<p>\r\n')
|
Write('<p>\r\n')
|
||||||
-- Write('OnHttpRequest() has intercepted your request<br>\r\n')
|
Write('OnHttpRequest() has intercepted your request<br>\r\n')
|
||||||
-- Write('because you specified the magic parameter\r\n')
|
Write('because you specified the magic parameter\r\n')
|
||||||
-- Write('<pre>\r\n')
|
Write('<pre>\r\n')
|
||||||
-- Write(EscapeHtml(LoadAsset('/.init.lua')))
|
Write(EscapeHtml(LoadAsset('/.init.lua')))
|
||||||
-- Write('</pre>\r\n')
|
Write('</pre>\r\n')
|
||||||
-- else
|
else
|
||||||
-- Route() -- this asks redbean to do the default thing
|
Route() -- this asks redbean to do the default thing
|
||||||
-- end
|
end
|
||||||
-- SetHeader('Server', 'redbean!')
|
SetHeader('Server', 'redbean!')
|
||||||
-- end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue