Knotter is a micro framework to create web application
knot module is a nodejs middleware to create websites.
I really love ExpressJS and Connect. But what I wanted to do was to implement a pseudo WSGI-like system. The main goal is to bundle some of my prefered modules in one place:
At this time, you need to do some operation manually:
cd /path/to/yor/working/directory npm install underscore swig mime sessions cd node_modules git clone firstname.lastname@example.org:metal3d/knot.git cd ..
Then, you can implement your first appliction, create a "site.js" file:
var knot = require'knot';//handler should serve get, post, put, delete requests//you only have to implement route (as regexp) with right namevar Page1Handler =route: '/page1'// there you can get: this.sessions, this.response, this.request// and this.aparams (ordered from captured regexp if any)// you can write response with this.end("Text to send to client");// or render a template: this.render('path to template', context_object)thisresponseend"Welcome on page 1 !";;var server = knotServerhandlers : Page1Handler //list of handlers,statics : 'css' 'js' // directory names to be served staticallytemplatess: './content/templates' // directory where templates can be found;serverserve; //default listen on 0.0.0.0:8000 (open 127.0.0.1:8000/page1 to check result)