1.0.1 • Published 8 years ago

bedrock-router v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Bedrock Router

A rule-based HTTP router for NodeJS.

Motivation

Express is great, but it is limited when one wants to use it for advanced use cases, such as statistics gathering. Bedrock router solves these issues.

Route patterns

Bedrock routes use a combination of micromatch and expressjs-style pattern matching to enable maximum flexibility while remaining performant.

Valid routes:

GET /
DELETE /path/to/:foo*
?(PUT|POST) /some/:name

Middleware

This has yet to be completed.

API

new Router(options)

Currently takes no options.

router.addRoute(pattern, callback)

Adds a single route to the router.

As seen in

Bedrock is used in the Comet platorm and in a component of GalacticJS.