Skip to content

NicholasKyleHoffman/node-mongo-crm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-mongo-crm

Following LinkedIn Learning tutorial at https://www.linkedin.com/learning/building-restful-web-apis-with-node-js-and-express/

Using the Following Technologies (see package.json - npm install upon clone of repo):

Below Apps allow you to See Your APIs & Backend Data

====================================

CLI Commands & Process:

Have 3 Terminals Open:

Terminal/CLI #1:
navigate to 'C://data/db'
Start Mongo: 'mongod'

Console #2:
navigate to 'node-mongo-crm' root dir
Start 'node-mongo-crm' App: 'npm start'

Console #3 (optional):
navigate to 'node-mongo-crm' root dir
Git status / push / pull

Robomongo:
Have Postman Open for HTTP API request checking. Validation that custom HTTP/API endpoints are working.
(Studio 3T connected to mongodb instance via port # - verify correct port from Console #1)
Have MongoDB Compass open (for viewing data)

Navigate To:
Open the following in browser: localhost://4200
Note: you will see "Node & express server running on port 4200" if everything worked.
Try navigating to localhost://4200 & note changes on Console #2!
Navigate to localhost://4200/sky.jpeg (example of static image loading using this single line of code
in index.js: 'app.use(express.static('public/images'));'

===========================================================================

Setup:
git clone repo
npm install && npm update
have downloaded MongoDB, Postman, and Robomongo
start mongo with 'mongod' (from 'C://data/db') ---
^^^ TROUBLESHOOTING WINDOWS: make sure the application route is in your PATH variable
(Ref: https://teamtreehouse.com/community/windows-add-mongodb-directory-to-path-environmental-variable-for-easy-command-line-interaction)
from node-mongo-crm folder, run 'npm start'
^^^ TROUBLESHOOTING WINDOWS: If application keeps stopping, you may have to kill process at port# 4200
(Ref: https://developers.de/blogs/indraneel/archive/2017/10/18/kill-a-process-in-windows-by-port-number.aspx)
navigate to localhost://4200
have run mongod command BEFOREconnecting to your port in Robomongo/Studio 3T
create collection in postman specifically for this app - localhost://4200 is default. ENSURE for POST & PUT
routes/endpoints you select "x-www-form-urlencoded" under Body radio button. This is for json data.
have fun :)

===========================================================

Next Steps: