Package Exports
- routes-router
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (routes-router) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
routes-router
Simplest router possible
Example
var Router = require("routes-router")
var http = require("http")
var router = Router()
http.createServer(router)
router.addRoute("/foo", function (req, res) {
res.end("hello!")
})
router.addRoute("/bars/:barName", function (req, res, opts) {
res.end("you request bars " + opts.params.barName)
})
router.addRoute("/baz/:things", {
GET: function (req, res) {
res.end("I will give you your thing")
},
POST: function (req, res) {
res.end("got your things")
}
})
Installation
npm install routes-router
Contributors
- Raynos