Barebones NodeJS - Express Server to demonstrate handling API requests and connecting to a mongoDB server.
Make sure you have NodeJS installed on your computer. You can find a proper download link here. Download the full current version.
In order to download the needed packages to run this, navigate to the root folder of this project and run npm install
. This will automatically install all the packages located in package.json
In the root folder from console run node index.js
and this will start the program.
The entry point for nodejs apps is typically index.js
or server.js
. Depends on the developer.
In the config folder, you need to create a db.js
file. please read howTO.txt for more information.
Download nodemon
which automatically restarts the node server when you make changes. The default node
command does not refresh when you make changes, making testing tedious. You can download nodemon by running npm i -g nodemon
this installs it globally so you can use it in any other nodejs project!
Please review code, as there will be comments explaining how everything works.