Skip to content

An awfully simple regex parameter based HTTP router for Node.js apps

License

Notifications You must be signed in to change notification settings

tmuellerleile/node-simplerouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-simplerouter

An awfully simple regex parameter based HTTP router

Usage

var http = require('http');
var simplerouter = require('simplerouter');

var router = simplerouter({
    url: '/hello',
    action: function (req, res) {
        res.writeHead(200, {'Content-Type': 'text/plain'});
        res.end('Hello World\n');
    },
    method: 'GET' // optional
});

http.createServer(router).listen(1337, '127.0.0.1');

Requirements

none

License

MIT (see LICENSE)

About

An awfully simple regex parameter based HTTP router for Node.js apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published