# exroute

> A Simple, Opinionated way to manage express route definitions

Latest version **0.0.3** (published 2015-06-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install exroute
pnpm add exroute
yarn add exroute
bun add exroute
```

## 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.0.3 |
| Published | 2015-06-02 |
| First published | 2015-05-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Larry Eliemenye |
| Maintainers | bigmeech |
| Keywords | expressJS, router, route, controllers, express |

## Links

- npm: https://www.npmjs.com/package/exroute
- Repository: https://github.com/bigmeech/exroute
- Issues: https://github.com/bigmeech/exroute/issues
- npm.io page: https://npm.io/package/exroute

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) ^5.0.6
- [lodash](https://npm.io/package/lodash.md) ^3.8.0
- [deasync](https://npm.io/package/deasync.md) ^0.1.0
- [express](https://npm.io/package/express.md) ^4.12.4
- [canonical-path](https://npm.io/package/canonical-path.md) 0.0.2

## 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

- 0.0.3 (latest) — 2015-06-02
- 0.0.2 — 2015-05-19
- 0.0.1 — 2015-05-19
- 1.0.0 — 2015-05-19

## README

### ExRoute

Manage and load your API routes without messing up your app.js file


## Installation
```
npm install exroute
```

## Usage
```
var exroute = require('exroute');
```

## In your app.js file
```
exroute.init(app, {
    caseSensitive:false,
    mergeParams:false,
    strict:false,
    routesDirectory:'routes/**/*.js'
});
```


## A sample route file
```
function usersGet(req, res, next) {
    res.json({});
}

function createUser(res, req, next){
    res.json({});
}

function isAuth(){
    res.json({});
};

module.exports = function usersRoute() {
    return {
        rootPath: '/api/users',
        routes: [
            {
                path: '/',
                get: [ isAuth, usersGet],
                post:[ createUser ]
            }
        ]
    }
};
```

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