Mercurial Hosting > luan
diff http/src/luan/modules/http/run.luan @ 503:92c3d22745b8
make _ENV optional
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 20 May 2015 23:24:46 -0600 |
parents | ee55be414a34 |
children | 7bc63886d4f2 |
line wrap: on
line diff
--- a/http/src/luan/modules/http/run.luan Tue May 19 17:57:20 2015 -0600 +++ b/http/src/luan/modules/http/run.luan Wed May 20 23:24:46 2015 -0600 @@ -7,6 +7,8 @@ local String = require "luan:String" local Html = require "luan:Html" +local M = {} + local function lines(s) local matcher = s.gmatch "([^\n]*)\n|([^\n])+$" return function() @@ -16,7 +18,7 @@ end local function print_with_line_numbers(s) - i = 1 + local i = 1 for line in lines(s) do print(i,line) i = i + 1 @@ -47,7 +49,7 @@ </html> <% end -function respond() +function M.respond() Io.stdout = Http.response.text_writer() local code = Http.request.parameter.code if code == nil then @@ -76,3 +78,5 @@ end; } end + +return M