Skip to content

niabb/express-openapi-mongoose-template

Repository files navigation

express-openapi-mongoose-template

Template for quickly creating a production ready REST API, compliant to the OAS 3 protocol.

This template uses:

  • winston for logging
  • mongoose as MongoDB ORM
  • JSON web token for authentication
  • Socket.io for websocket communication.
  • Swagger UI for the API documentation

For the development:

  • Linting with eslint and Airbnb rule
  • Mocha/chai/should for unit testing

When running, the API definition file is served on /api-docs.

How to clone and keep up to date

Clone:

git clone https://github.com/niabb/express-openapi-mongoose-template.git newRepo
cd newRepo
git remote set-url origin https://github.com/userName/newRepo
git remote add upstream https://github.com/niabb/express-openapi-mongoose-template
git push origin master
git push --all

Keep up to date:

git pull upstream master

How to run the app

Create the configuration file: cp default.env .env and edit it to match your environment. Then start the app: npm run start

Development

Run the app in development mode with nodemon: npm run watch Run ESLint: npm run lint Play unit tests:

# First, create the test .env file and fill it to match the test environment
cp default.env test/.env
npm run test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published