comparison http/src/luan/modules/http/HttpTest.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
comparison
equal deleted inserted replaced
504:dbdf4b8193a8 505:7bc63886d4f2
10 if M.welcome_file ~= nil and path.matches ".*/" then 10 if M.welcome_file ~= nil and path.matches ".*/" then
11 path = path .. M.welcome_file 11 path = path .. M.welcome_file
12 end 12 end
13 local old_out = Io.stdout 13 local old_out = Io.stdout
14 local mod = require("site:"..path) 14 local mod = require("site:"..path)
15 mod.respond() 15 mod()
16 M.text_writer.close() 16 M.text_writer.close()
17 Io.stdout = old_out 17 Io.stdout = old_out
18 return M.result.read_text() 18 return M.result.read_text()
19 end 19 end
20 20