# basic-router-framework

> This package contains a "router.js" file which can be added to node programs via a require statement. The files in the "routes" directory, as well as the "server.js" are examples of how the framework can be used.

Latest version **0.1.0** (published 2016-03-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install basic-router-framework
pnpm add basic-router-framework
yarn add basic-router-framework
bun add basic-router-framework
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-03-14 |
| First published | 2016-03-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lex Myers |
| Maintainers | lexm |

## Links

- npm: https://www.npmjs.com/package/basic-router-framework
- npm.io page: https://npm.io/package/basic-router-framework

## Recent versions

- 0.1.0 (latest) — 2016-03-14

## README

#Basic Routing Framework

This package contains a "router.js" file which can be added to node programs via a require statement. The files in the "routes" directory, as well as the "server.js" are examples of how the framework can be used.

Once a new Router() object is created, the .post(), .get(), .put(), and .delete() methods can be called to assign callbacks. The format is:

newRouter.post(resourceName, callback);

"resourceName" is the name of the resource as specified in the URL. For instance, in http://domain.name/rocks/14, the resourceName would be "rocks". The callback function will be passed three parameters corresponding to the HTTP request, the response, and an array created by splitting the request.url field by the slash ('/') character. then removing the first element in the array if it's blank. This allows the rest of the url to be accessed: for instance, splitUrl[1] in the above example would be "14".

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