A REST API boilerplate for NodeJS that uses collections of basic practices: Auth, Security, RESTful resources, API docs, Testing and Logging.
Uses MongoDB as its database and Passport for authentication with (jwt).
- Express
- Mongodb
- Babel (preset 2015)
- Passport
- JsonWebToken
- Mongoose
- SwaggerUI
- Morgan, Helmet, Cors
- Mocha, Chai, Supertest
- Winston
- Docker
Clone this repository and install dependencies
> git clone git@github.com:jeescu/express-rest-api.git
> cd express-rest-api
> npm install
> npm run dev
> npm run start
Unit tests:
> npm run test:specs
Black-box end-to-end tests:
npm run test:e2e
Or run both tests:
> npm test
> npm run lint
> cd express-rest-api
# Build your docker
> docker build -t rest-api .
# Run your docker image with the tag name
> docker run -p 8080:8080 rest-api
Checkout localhost:8080/docs
.
When using Apiary, create new project api using swagger and
copy swagger.json
content to the editor and publish it. See example.
MIT