Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Utilities functions for node.js that borrow some useful concepts from Django

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 static-demo
Octocat-spinner-32 template-demo
Octocat-spinner-32 template
Octocat-spinner-32 utils
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.txt
Octocat-spinner-32 TEMPLATES.md
Octocat-spinner-32 djangode.js
Octocat-spinner-32 example.js
Octocat-spinner-32 license.txt
Octocat-spinner-32 regression.py
Octocat-spinner-32 template_example.js
README.txt
djangode
========

Utility functions for node.js that imitate some useful concepts from Django.

    http://nodejs.org/
    http://www.djangoproject.com/

Example usage:

    var dj = require('./djangode');
    dj.serve(dj.makeApp([
        ['^/$', function(req, res) {
            dj.respond(res, '<h1>Homepage</h1>');
        }],
        ['^/other$', function(req, res) {
            dj.respond(res, '<h1>Other page</h1>');
        }],
        ['^/page/(\\d+)$', function(req, res, page) {
            dj.respond(res, '<h1>Page ' + page + '</h1>');
        }]
    ]), 8008); // Serves on port 8008

Run "node example.js" for a slightly more interesting example.
Something went wrong with that request. Please try again.