Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple and fast router for Connect
JavaScript
tree: 1f02075565

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.npmignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

build status

About

Simple and fast router for Connect

Installation

npm install connect-route

Usage

var
    connectRoute = require('connect-route');
    connect = require('connect'),
    app = connect();

app.use(connectRoute(function (router) {
    router.get('/', function (req, res, next) {
        res.end('index');
    });

    router.get('/home', function (req, res, next) {
        res.end('home');
    });

    router.get('/home/:id', function (req, res, next) {
        res.end('home ' + req.params.id);
    });

    router.post('/home', function (req, res, next) {
        res.end('POST to home');
    });
}));

app.listen(3000);
Something went wrong with that request. Please try again.