Just your reg router to match routes based on provided regex.
var router = require('reg-router')()
router.route(/^\/reset$/, function (req, res, params) {
res.writeHead(200, 'reset route is hit', { 'content-encoding': 'application/json' })
}
http.createServer(function (req, res) {
router.match(req, res)
}).listen(8080)
Creates a new instance off reg-router.
Register a new route. Handler is generally req, res, params
.
Defaults to sending back a 404, but you can provide your own default. router.default
will do this for you.
Match requests to registered routes. Would usually use when server's fired up.