Mercurial Hosting > luan
comparison website/src/examples/hi.luan @ 505:7bc63886d4f2
web page modules now return a function
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 May 2015 01:45:49 -0600 |
parents | 92c3d22745b8 |
children | ca169567ce07 |
comparison
equal
deleted
inserted
replaced
504:dbdf4b8193a8 | 505:7bc63886d4f2 |
---|---|
1 local Io = require "luan:Io" | 1 local Io = require "luan:Io" |
2 local Http = require "luan:http/Http" | 2 local Http = require "luan:http/Http" |
3 | 3 |
4 local M = {} | |
5 | 4 |
6 function M.respond() | 5 return function() |
7 Io.stdout = Http.response.text_writer() | 6 Io.stdout = Http.response.text_writer() |
8 %> | 7 %> |
9 <html> | 8 <html> |
10 <body> | 9 <body> |
11 Hello World | 10 Hello World |
12 </body> | 11 </body> |
13 </html> | 12 </html> |
14 <% | 13 <% |
15 end | 14 end |
16 | |
17 return M |