# routes-getter

> Walks through your routes folder and imports them to your project.

Latest version **0.0.4** (published 2016-11-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install routes-getter
pnpm add routes-getter
yarn add routes-getter
bun add routes-getter
```

## 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.4 |
| Published | 2016-11-09 |
| First published | 2016-11-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Nitin Tulswani |
| Maintainers | nitin42 |

## Links

- npm: https://www.npmjs.com/package/routes-getter
- npm.io page: https://npm.io/package/routes-getter

## Dependencies (3)

- [ejs](https://npm.io/package/ejs.md) ^2.5.2
- [should](https://npm.io/package/should.md) ^11.1.1
- [express](https://npm.io/package/express.md) ^4.14.0

## Recent versions

- 0.0.4 (latest) — 2016-11-09

## README

# routes-getter

> ***Accessible routes in your ExpressJS application***

![Centered image](https://upload.wikimedia.org/wikipedia/commons/thumb/6/64/Expressjs.png/280px-Expressjs.png)

An easy way of working with your routes in [ExpressJS](https://expressjs.com) applications.
It walks through your routes folder and imports them to your project.

**Note** - It does not walk through the `middlewares` folder in your `routes` folder. Since they are used and shared by routes as further middlewares. 

#### Table of Contents

* Installation
* Examples
* API

## Installation

```
npm install -g routes-getter
```

## Examples

Assuming the `src` directory to be the application folder, this is how you will define the routes

```javascript
// src/routes/index.js

module.exports = (app) => {
	app.get('/', (req, res) => x{
		res.render('../views/index.html');
	});
}
```
`server.js` file in your app directory.

```javascript
const express = require('express');
const loader = require('routes-getter');

const app = express();

loader.routers(__dirname + '/routes', app); // Loads the routes in your application
```


## API

### loader.routers([options])

### options

#### path

*Required*<br>

Path to routes in your application folder.

#### app

*Required*<br>

app should be instance of **express**

## Tests

```
npm test
```

## Contributing
	
Add unit tests for any new or changed functionality.

## License

ISC

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