This package has been deprecated

Author message:

This package has been deprecated. If you want to take over the package name, contact the author or npm directly.

bedrock-routes

1.0.0 • Public • Published

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.

API

const WebApp = require('bedrock-routes').WebApp

new WebApp()

Constructs a new router. A router is an extension of Node's http.Server.

In addition to the usual Node HTTP events, these events are emitted:

  • processingError: when the route produced an error message
  • notFound: when no rule was found for the specified request

app.listen(port?)

Listens on the specified port, or a random available port if no port is specified. Returns an empty promise.

app.addRoute(route, callback)

Adds a route to the application. Callback has the form (req, res) => any, where any can be a promise which possibly gets rejected.

Trivia

Manabi is named after a reqion in Ecuador which produces coffee beans.

Readme

Keywords

Package Sidebar

Install

npm i bedrock-routes

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • samvv