Put redbean lua init demo code

This commit is contained in:
Justine Tunney 2022-04-22 19:14:49 -07:00
parent 2f56ebfe78
commit cf3174dc74

View file

@ -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