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.
- Use this template to create a new repository
- Clone the generated repository
- Install dependencies:
yarn
- Run project:
yarn dev
In the project directory, you can run:
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.
Launches the test runner in the interactive watch mode.
This will run tests using jest
and lint files using eslint
.
Collects test coverage with jest
.
Coverage report will be reported in the console and in the coverage
folder.
Lints project files using eslint
.
You can run yarn lint --fix
to autofix fixable issues.
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
.
Runs the project in production mode.
Make sure you run yarn build
before this script.
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.