Mercurial Hosting > luan
comparison website/src/tutorial.html.luan @ 736:2113294ccc6d 0.20
minor
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Fri, 24 Jun 2016 14:38:56 -0400 |
| parents | ca169567ce07 |
| children | 48506d03e230 |
comparison
equal
deleted
inserted
replaced
| 735:2486fa6490c6 | 736:2113294ccc6d |
|---|---|
| 76 local Io = require "luan:Io.luan" | 76 local Io = require "luan:Io.luan" |
| 77 local Http = require "luan:http/Http.luan" | 77 local Http = require "luan:http/Http.luan" |
| 78 | 78 |
| 79 return function() | 79 return function() |
| 80 Io.stdout = Http.response.text_writer() | 80 Io.stdout = Http.response.text_writer() |
| 81 %> | 81 %> |
| 82 <html> | 82 <html> |
| 83 <body> | 83 <body> |
| 84 Hello World | 84 Hello World |
| 85 </body> | 85 </body> |
| 86 </html> | 86 </html> |
| 87 <% | 87 <% |
| 88 end | 88 end |
| 89 ]]%></pre> | 89 ]]%></pre> |
| 90 | 90 |
| 91 <p>Now go back to the parent directory and do <b>luan luan:http/serve.luan file:site</b>. This will run the Luan web server on port 8080. Try going to <a href="http://localhost:8080/">http://localhost:8080/</a>. You should see the directory. If you click on <b>hi.luan</b> you will see the source. But if you remove the <b>.luan</b> and just go to <a href="http://localhost:8080/hi">http://localhost:8080/hi</a> then you will run the program which will generate the web page.</p> | 91 <p>Now go back to the parent directory and do <b>luan luan:http/serve.luan file:site</b>. This will run the Luan web server on port 8080. Try going to <a href="http://localhost:8080/">http://localhost:8080/</a>. You should see the directory. If you click on <b>hi.luan</b> you will see the source. But if you remove the <b>.luan</b> and just go to <a href="http://localhost:8080/hi">http://localhost:8080/hi</a> then you will run the program which will generate the web page.</p> |
| 92 | 92 |
