Create express API backend with MongoDB
-
Clone the template
-
Create a
.env
file and define the following environment variables- CONNECTION_STRING (required): This is the connection string to a MongoDB database.
- PORT (optional): The port to serve the app from.
-
start the dev server with
yarn startdev
. -
Start the production server with
yarn start
. The command outputs a production build, then serves it.
- Run the command
yarn test