Mercurial Hosting > luan
annotate examples/blog/src/private/tools/test.luan @ 882:d850a5e6ff15
remove UncheckedPrintWriter
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 04 Oct 2016 16:12:50 -0600 |
parents | e2eb55d86bb2 |
children |
rev | line source |
---|---|
693
ca169567ce07
module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
598
diff
changeset
|
1 local Luan = require "luan:Luan.luan" |
598 | 2 local do_file = Luan.do_file |
3 local try = Luan.try | |
693
ca169567ce07
module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
598
diff
changeset
|
4 local Io = require "luan:Io.luan" |
598 | 5 local print = Io.print |
693
ca169567ce07
module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents:
598
diff
changeset
|
6 local Http = require "luan:http/Http.luan" |
598 | 7 |
8 | |
9 return function() | |
10 Io.stdout = Http.response.text_writer() | |
11 Http.response.content_type = "text/plain" | |
12 try { | |
13 function() | |
14 do_file "site:/lib/test.luan" | |
15 end; | |
16 catch = function(e) | |
17 print() | |
18 print("error:",e) | |
19 end; | |
20 } | |
789 | 21 local Db = require "site:/lib/Db.luan" |
598 | 22 Db.close() |
23 end |