Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    connect-routepublic

    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);

    install

    npm i connect-route

    Downloadsweekly downloads

    6,999

    version

    0.1.5

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar