Skip to content

Boilerplate Code Written using Nodejs express and Es8 with best practices

License

Notifications You must be signed in to change notification settings

shekhar-raval/node-express-es8

Repository files navigation

PRs Welcome Build Status Coverage Status Known Vulnerabilities node version express mongoose jsonwebtoken LICENCE code style Dependencies

Node.js - Express, MongoDB, ES8 REST API Boilerplate

Features

Take a demo at Link Soon Coming...

Prerequisites

Getting Started

  1. Clone the repo and make it yours:
git clone https://github.com/shekhar-raval/node-express-es8 node-api
cd node-api
rm -rf .git
  1. Install dependencies:
npm install
  1. Set environment variables:
cp .env.example .env

Running Locally

npm run dev

Running in Production

npm run start

Lint

# lint code with ESLint
npm run lint

# try to fix ESLint errors
npm run lint:fix

# lint and watch for changes
npm run lint:watch

Test

# run all tests with Mocha
npm run test

# run unit tests
npm run test:unit

# run integration tests
npm run test:integration

# run all tests and watch for changes
npm run test:watch

# open nyc test coverage reports
npm run coverage

Validate

# run lint and tests
npm run validate

Documentation

# generate and open api documentation
npm run docs

Docker

# run container in production
npm run docker:prod
or
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up

# run tests
npm run docker:test
or
docker-compose -f docker-compose.yml -f docker-compose.test.yml up

Rate Limit Configuration

Change configuration in .env file