comparison website/src/tutorial.html.luan @ 1309:5684a14582c4

move website to www.luan.ws
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 24 Jan 2019 00:55:10 -0700
parents 4c2972f4d862
children 3860ed4b8552
comparison
equal deleted inserted replaced
1308:70eecde81820 1309:5684a14582c4
94 94
95 <p>The Luan webserver expects the file to return a function and calls it to generate the page. Code of the form <b><%=Html.encode[[%>...<%]]%></b> writes its output to <b>Io.stdout</b> which by default is the standard output of the command line. So in the returned function one usually starts by setting <b>Io.stdout</b> to a <code>text_writer</code> which writes its output to the HTTP response (to the web browser).</p> 95 <p>The Luan webserver expects the file to return a function and calls it to generate the page. Code of the form <b><%=Html.encode[[%>...<%]]%></b> writes its output to <b>Io.stdout</b> which by default is the standard output of the command line. So in the returned function one usually starts by setting <b>Io.stdout</b> to a <code>text_writer</code> which writes its output to the HTTP response (to the web browser).</p>
96 96
97 <p>You can find this example and others in the <a href="examples/">examples directory</a>. Take a look at <a href="examples/hi2.luan">hi2.luan</a> next. Remember to remove the <b>.luan</b> from the URL to run the code. And by the way, you can see the source for this page at <a href="tutorial.html.luan">tutorial.html.luan</a>.</p> 97 <p>You can find this example and others in the <a href="examples/">examples directory</a>. Take a look at <a href="examples/hi2.luan">hi2.luan</a> next. Remember to remove the <b>.luan</b> from the URL to run the code. And by the way, you can see the source for this page at <a href="tutorial.html.luan">tutorial.html.luan</a>.</p>
98 98
99 <p>So now you have built your website and you want to publish it to the web. If you have your own domain, create a CNAME record for it pointing to <b>s1.luanhost.com</b>. If you don't have a domain, just use a domain like <b>bob.s1.luanhost.com</b> (anything of the form <b>*.s1.luanhost.com</b>). Assuming your directory is <b>site</b> and you will use the password <b>secret</b>, do the following from the command line: 99 <p>So now you have built your website and you want to publish it to the web. If you have your own domain, create a CNAME record for it pointing to <b>s1.luan.ws</b>. If you don't have a domain, just use a domain like <b>bob.s1.luan.ws</b> (anything of the form <b>*.s1.luan.ws</b>). Assuming your directory is <b>site</b> and you will use the password <b>secret</b>, do the following from the command line:
100 100
101 <pre> 101 <pre>
102 luan luan:host/push.luan bob.s1.luanhost.com secret site 102 luan luan:host/push.luan bob.s1.luan.ws secret site
103 </pre> 103 </pre>
104 104
105 <p>The form is <b>luan luan:host/push.luan domain password directory</b>. If you change your site, just run this again and your site will be updated. To delete your site, do <b>luan luan:host/delete.luan domain password</b>.</p> 105 <p>The form is <b>luan luan:host/push.luan domain password directory</b>. If you change your site, just run this again and your site will be updated. To delete your site, do <b>luan luan:host/delete.luan domain password</b>.</p>
106 106
107 <p>Hopefully this short tutorial gave you an idea of how to use Luan to make a website.</p> 107 <p>Hopefully this short tutorial gave you an idea of how to use Luan to make a website.</p>