An altogether unnecessary little web framework inspired by Django
var djanky = require('djanky');
function index(request, response, name) {
return 'Hello, ' + name + '!';
}
var routes = [
['^/(.*)$', index, 'index']
];
var server = new djanky.Server(1337, routes);
server.start();
The core Djanky class.
new djanky.Server( <port>, <routes> )
port
- The port to listen to. Defaults to 8080.routes
- an Array of routes, stored as an Array of 3 values:[_pattern_, _handler_, _name_]
- TODO: write this.
- TODO: write this.