annotate website/src/examples/hi.luan @ 503:92c3d22745b8

make _ENV optional
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 20 May 2015 23:24:46 -0600
parents 598123096772
children 7bc63886d4f2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
382
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Io = require "luan:Io"
494
2b9bc97f0439 change luan:web to luan:http
Franklin Schmidt <fschmidt@gmail.com>
parents: 388
diff changeset
2 local Http = require "luan:http/Http"
382
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3
503
92c3d22745b8 make _ENV optional
Franklin Schmidt <fschmidt@gmail.com>
parents: 495
diff changeset
4 local M = {}
388
12ee9a336b95 add more examples
Franklin Schmidt <fschmidt@gmail.com>
parents: 382
diff changeset
5
503
92c3d22745b8 make _ENV optional
Franklin Schmidt <fschmidt@gmail.com>
parents: 495
diff changeset
6 function M.respond()
382
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 Io.stdout = Http.response.text_writer()
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8 %>
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 <html>
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 <body>
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 Hello World
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 </body>
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 </html>
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 <%
8557581740db added tutorial
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 end
503
92c3d22745b8 make _ENV optional
Franklin Schmidt <fschmidt@gmail.com>
parents: 495
diff changeset
16
92c3d22745b8 make _ENV optional
Franklin Schmidt <fschmidt@gmail.com>
parents: 495
diff changeset
17 return M