mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-03 07:29:23 +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');
|
||||
]]
|
||||
|
||||
-- -- this intercepts all requests if it's defined
|
||||
-- function OnHttpRequest()
|
||||
-- if HasParam('magic') then
|
||||
-- Write('<p>\r\n')
|
||||
-- Write('OnHttpRequest() has intercepted your request<br>\r\n')
|
||||
-- Write('because you specified the magic parameter\r\n')
|
||||
-- Write('<pre>\r\n')
|
||||
-- Write(EscapeHtml(LoadAsset('/.init.lua')))
|
||||
-- Write('</pre>\r\n')
|
||||
-- else
|
||||
-- Route() -- this asks redbean to do the default thing
|
||||
-- end
|
||||
-- SetHeader('Server', 'redbean!')
|
||||
-- end
|
||||
-- this intercepts all requests if it's defined
|
||||
function OnHttpRequest()
|
||||
if HasParam('magic') then
|
||||
Write('<p>\r\n')
|
||||
Write('OnHttpRequest() has intercepted your request<br>\r\n')
|
||||
Write('because you specified the magic parameter\r\n')
|
||||
Write('<pre>\r\n')
|
||||
Write(EscapeHtml(LoadAsset('/.init.lua')))
|
||||
Write('</pre>\r\n')
|
||||
else
|
||||
Route() -- this asks redbean to do the default thing
|
||||
end
|
||||
SetHeader('Server', 'redbean!')
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue