Skip to content

A simple template based on Express and Mongoose that helps you build flexible and simple REST APIs

License

Notifications You must be signed in to change notification settings

Dramloc/express-mongoose-template

Repository files navigation

express-mongoose-template

This project was bootstrapped with express-mongoose-template, a simple template based on Express and Mongoose that helps you build flexible and simple REST APIs.

Usage

  • Use this template to create a new repository
  • Clone the generated repository
  • Install dependencies:
    yarn
  • Run project:
    yarn dev

Available Scripts

In the project directory, you can run:

yarn dev

Runs the project in the development mode.
API will be served on http://localhost:8080.

The project will reload with nodemon if you make edits.
You will also see any babel compilation error in the console.

yarn test

Launches the test runner in the interactive watch mode.
This will run tests using jest and lint files using eslint.

yarn coverage

Collects test coverage with jest.
Coverage report will be reported in the console and in the coverage folder.

yarn lint

Lints project files using eslint.
You can run yarn lint --fix to autofix fixable issues.

yarn build

Builds the project with babel to make it ready for production. The output will be generated in the dist folder.
This should be run before launching yarn start.

yarn start

Runs the project in production mode.
Make sure you run yarn build before this script.

Configuration

Application configuration is provided by environment variables and accessed in code with process.env.VARIABLE_NAME.

Environments variables are loaded using the definitions in the .env.defaults file. If you need to override some of them, you can create a .env file with your overrides.

If new environment variables are required by the app, they can be added to the .env.defaults to document them.

About

A simple template based on Express and Mongoose that helps you build flexible and simple REST APIs

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks