mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-05 15:43:48 +07:00
Added Lua section to the user manual
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
-- Lua server pages have full control over the output, including HTTP
|
||||
-- headers they send to the client. Send HTTP headers:
|
||||
print('HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n')
|
||||
|
||||
?><html><body>
|
||||
|
||||
<p>This is an example Lua server page served by
|
||||
@@ -10,6 +11,14 @@ Mongoose has Lua, Sqlite, and other functionality built in the binary.
|
||||
This example page stores the request in the Sqlite database, and shows
|
||||
all requests done previously.</p>
|
||||
|
||||
<p> Today is <? print(os.date("%A")) ?>
|
||||
<p> HTTP headers: <br>
|
||||
<?
|
||||
for name, value in pairs(request_info.http_headers) do
|
||||
print(name, ' : ', value, '<br>')
|
||||
end
|
||||
?>
|
||||
|
||||
<pre>
|
||||
<?
|
||||
-- Open database
|
||||
|
||||
Reference in New Issue
Block a user