-- redbean lua server page demo local function main() -- This check is pedantic but might be good to have. if GetMethod() ~= 'GET' and GetMethod() ~= 'HEAD' then ServeError(405) SetHeader('Allow', 'GET, HEAD') return end -- These two lines are optional. -- The default behavior is to do this if you don't. SetStatus(200) -- Shorthand for SetStatus(200, "OK") SetHeader('Content-Type', 'text/html; charset=utf-8') -- Response data is buffered until the script finishes running. -- Compression is applied automatically, based on your headers. Write('\n') Write('
\n')
Write('none
\n')
Write('ProTip: Try clicking here!\n')
end
-- Access redbean command line arguments.
-- These are the ones that come *after* the redbean server arguments.
Write('
none\n') end Write('