Skip to content
stoffera edited this page Oct 10, 2012 · 4 revisions

To get started with Duality you should read this documentation. It takes you through the simple basics, builds more advanced topics on top of that. Before proceeding you should have downloaded the duality source file. See the Installation page on how to do this.

###A quick example A simple static server, that just server files from a directory:

	var duality = require('./duality');
	var server = duality.createServer("/var/www");

And that is it. A duality server instance now serves every file found inside /var/www/. Note that directory listing is not supported by duality at this point.

Next, lets say you are hosting a blog through the duality server. All static files like html, js, css and images gets served by the static method. Now functions for returning a list of posts and individual posts are needed. To do this read the next step on Routes

Clone this wiki locally