A simple boilerplate for NODEJS, EXPRESS and MONGODB REST API development .
-
Make sure you have node.js v14 + npm v8 or above installed and ts-node installed.
-
Clone this repo and cd into it using
git clone [email protected]:iamsirmike/node-mongo-boilerplate.git && cd node-mongo-boilerplate
. -
This project requires a MongoDB server. Make sure you have an active MongoDB instance locally (example here) or remote (example here)
-
Create a file named
.env
in the base of your folder and add the mongo url from step 3 above like this
.env
MONGO_URL=<url>
Replace <url>
with the actual url.
-
To get the project ready, run
npm install
. -
To run the project:
- To automatically rerun when you save, run
npm run watch
- To run once, run
npm run start
- To run tests
npm run test
- To automatically rerun when you save, run
Now you are ready to rumble!