REST API Boilerplate
🔧 Setup
- Open up your favourite terminal (and navigate somewhere you want to download the repository to)
- 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.
- 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.
- Install all dependencies by typing
$ npm install
- Copy
config.template.js
and paste it as config.js
- Configure it in your favourite editor by editing
config.json
- 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.
💠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