Skip to content

NullDev/REST-API-Boilerplate

Repository files navigation

REST API Boilerplate

An ExpressJS based REST API Boilerplate


🔧 Setup

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

  2. 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.

  3. 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.

  4. Install all dependencies by typing
    $ npm install

  5. Copy config.template.js and paste it as config.js

  6. Configure it in your favourite editor by editing config.json

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