# bedrock-router

> A rule-based HTTP router for NodeJS

Latest version **1.0.1** (published 2016-07-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install bedrock-router
pnpm add bedrock-router
yarn add bedrock-router
bun add bedrock-router
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-07-20 |
| First published | 2016-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Sam Vervaeck |
| Maintainers | samvv |
| Keywords | http, server, router, api |

## Links

- npm: https://www.npmjs.com/package/bedrock-router
- Repository: https://github.com/samvv/manabi
- Homepage: https://github.com/samvv/manabi#readme
- Issues: https://github.com/samvv/manabi/issues
- npm.io page: https://npm.io/package/bedrock-router

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.13.1
- [micromatch](https://npm.io/package/micromatch.md) ^2.3.10
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^1.5.3

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-07-20
- 1.0.0 — 2016-07-20

## README

Bedrock Router
==============

> A rule-based HTTP router for NodeJS.

## Motivation 

[Express](expressjs.com) 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](https://github.com/jonschlinkert/micromatch) and [expressjs](http://expressjs.com/en/api.html)-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](http://github.com/comet-platform/comet-platform) and in a component of [GalacticJS](http://githb.com/GalacticJS).

---
_Source: https://npm.io/package/bedrock-router · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
