Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nulldev/rest-api-boilerplate

:satellite: ExpressJS Based REST API Boilerplate
https://github.com/nulldev/rest-api-boilerplate

api boilerplate expressjs nodejs rest-api restful server

Last synced: 24 days ago
JSON representation

:satellite: ExpressJS Based REST API Boilerplate

Awesome Lists containing this project

README

        

# REST API Boilerplate


An ExpressJS based REST API Boilerplate


## :wrench: Setup

0. Open up your favourite terminal (and navigate somewhere you want to download the repository to)


1. Make sure you have NodeJS installed. Test by entering

$ `node -v`

If this returns a version number, NodeJS is installed. **If not**, get NodeJS here.


2. Clone the repository and navigate to it. If you have Git installed, type

$ `git clone https://github.com/NullDev/REST-API-Boilerplate.git && cd REST-API-Boilerplate`

If not, download it here and extract the ZIP file.

Then navigate to the folder.


3. Install all dependencies by typing

$ `npm install`


4. Copy `config.template.js` and paste it as `config.js`


5. Configure it in your favourite editor by editing `config.json`


6. Start it by running

$ `npm start`

**Note:** You also need *cross-env* ($ `sudo npm i -g cross-env`) globally installed as well as *eslint* ($ `sudo npm i -g eslint`) for testing.


## :diamond_shape_with_a_dot_inside: Features

- Easy API versioning (/v1/, /v2/)
- Adding routes without touching the init script (app.js)
- Configurable Rate Limiting
- Robots.txt generator
- Error handling
- Logger
- Production ready memory store for Ratelimiter
- Standard route scheme
- Support for multiple routers
- Route walker to display which route registered with what method