http-smpl-router
v0.1.1
Published
A simple router for node http module. Register routes and delegate HTTP requests directly to the router.
Downloads
5
Maintainers
Readme
Simple HTTP Router
A simple router for node.js http module. Register routes express.js style and delegate HTTP requests directly to the router.
Installation
npm install http-smpl-router
Usage
Register GET, POST, PUT, DELETE routes
var http = require('http');
var router = require('http-smpl-router');
http.createServer(function(req, resp){
router.route(req, resp);
}).listen(3000);
router.get('/helloworld', function(req, resp){
resp.end("<h1>Hello</h1>" + "World!!");
});
In your browser view http://localhost:3000/helloworld