Beak.js is a simple URL router for NodeJS.
npm install beak
git clone git://github.com/katsgeorgeek/beak.js.git
cd beak.js
npm link
var Router = require('beak');
var router = new Router();
router.get('/post/:id/', function(request, response) {
console.log(request.params.id);
});
http.createServer(router.listener).listen(HTTP_PORT, function () {
console.log('Server running at http://127.0.0.1:' + HTTP_PORT);
});
router.get
: MatchGET
requestsrouter.post
: MatchPOST
requestsrouter.put
: MatchPUT
requestsrouter.delete
: MatchDELETE
requests
If you find any issues with Beak.js or have any suggestions or feedback, please feel free to visit the github issues page.
MIT