Skip to content

pablos4nt0s/express-rest-api

Repository files navigation

express-rest-api travis Coverage Status Issue Count Commitizen friendly

simple, robust, REST API implementation

Node.js implementation of a REST API using express, mongoose and ES6. It uses JWT authentication and brute-force protection by rate limiting income requests. Also helps your team to promote best practices by following simple conventions.

features

install

Clone the repo:

git clone https://github.com/rectius/express-rest-api.git
cd express-rest-api

Install tools:

npm install -g istanbul coveralls commitizen

Install yarn:

npm install -g yarn

Install dependencies:

yarn

start server

Run server:

# Start server
yarn start

# Selectively set DEBUG env var to get logs
DEBUG=express-rest-api:* yarn start

Refer debug to know how to selectively turn on logs.

tests

Tests:

# Run tests written in ES6 along with code coverage
yarn test

# Run tests on file change
yarn test:watch

# Run tests enforcing code coverage (configured via .istanbul.yml)
yarn test:check-coverage

Lint:

# Lint code with ESLint
yarn lint

# Run lint on any file change
yarn lint:watch

Other gulp tasks:

# Wipe out dist and coverage directory
gulp clean

# Default task: Wipes out dist and coverage directory. Compiles using babel.
gulp

deployment

# compile to ES5
1. yarn build

# upload dist/ to your server
2. scp -rp dist/ user@dest:/path

# install production dependencies only
3. yarn --production

# Use any process manager to start your services
4. pm2 start dist/index.js

maintainers

Pablo Souza (Twitter: @pablo_souza)

license

MIT. Copyright (c) Pablo Souza.

About

REST API using express, mongoose and ES6

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published