0.1.0 • Published 10 years ago

unpm-router v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

unpm-router

HTTP router for unpm

Build Status

usage

var http = require('http')

var Router = require('unpm-router')
  , router

router = Router('/optional/root/directory')

router.add('method', 'route-to-match', handler_function)

http.createServer(function(req, res) {
  var result = router.match(req)

  if(result) {
    return result.fn(req, res, result)
  }

  res.writeHead(404)
  res.end('not found')
}).listen(4444)

notes

Internally, unpm-router uses routes for route matching, so all of its handy pattern matching functionality is available.

license

MIT

0.1.0

10 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago