No description or website provided.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
test
.gitignore
.testem.json
.travis.yml
LICENCE
README.md
index.js
package.json

README.md

routes-router

dependency status

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

MIT Licenced