REST API with Express and MongoDB.
|- node_modules
|- src
| |- db
| | |- database.js
| |- routes
| | |- task.js
| |- server.js
|- .env
|- .gitignore
|- package-lock.json
|- package.json
|- readme.md
- Node.js (v18.12.1 was the version used to build this project).
- MongoDB database server.
- Postman.
In order to execute the application the following steps are necessary:
-
Install node.js dependencies. Make sure to execute this command in the project root directory.
$ npm install
-
Environment variables setup. Create .env file in the root directory project and define the variables needed to connect to the MongoDB server.
DB_CONNECTION="database conexion string goes here"
-
Turn on MongoDB Server. Documentation.
-
Run the project. Make sure to execute this command in the project root directoty.
$ npm run start
Terminal output: App listening on port 4000.