Added Lua section to the user manual

This commit is contained in:
Sergey Lyubka
2013-02-27 10:44:59 +00:00
parent fc9a9593d2
commit a58bb71c19
2 changed files with 53 additions and 0 deletions
+9
View File
@@ -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