chicken-sloths / bangazon-api-sprint1

API for a mock Amazon + Etsy platform providing developers access to the company's employee & product data
0 stars 0 forks source link

Filepath errors with NOT running app.js in root #67

Closed DavidLarsKetch closed 6 years ago

DavidLarsKetch commented 6 years ago

Context

  1. PR #63 uses process.cwd() to provide filepaths for controllers/ & routes/, this will cause cannot find module errors if node app.js is not called from the same directory that app.js is in.

Associated Product Ticket

N/A

Process

  1. Instead of using process.cwd(), look at this StackOverflow for a solution: Determine project root from a running node.js application

Expected Result

Running node app.js should work from any directory inside or outside the project