Skip to content

Barebones NodeJS - Express Server to demonstrate handling API requests and connecting to a mongoDB server.

Notifications You must be signed in to change notification settings

JoePassanante/NodeJS-API-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS-API-Template

Barebones NodeJS - Express Server to demonstrate handling API requests and connecting to a mongoDB server.

Getting Started

Make sure you have NodeJS installed on your computer. You can find a proper download link here. Download the full current version.

Working with NPM

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

Running the server

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.

Setting up MongoDB

In the config folder, you need to create a db.js file. please read howTO.txt for more information.

Suggestion

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!

Notes

Please review code, as there will be comments explaining how everything works.

About

Barebones NodeJS - Express Server to demonstrate handling API requests and connecting to a mongoDB server.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published