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

Refactor of filepaths, adds indexes for routes/ & fixes typos on routes/index.js #63

Closed DavidLarsKetch closed 6 years ago

DavidLarsKetch commented 6 years ago

Description

Three aims:

  1. Changes the filepaths in controllers & routes to absolute filepaths through the process.cwd() method.
  2. Adds routes/employees/index.js & routes/products/index.js to funnel the various to routes/index.js in a cleaner fashion.
  3. Fixes typos in routes/index.js with app & router

Number of Fixes

N/A

Related Ticket(s)

N/A

Problem to Solve

Solves readability problems of ungainly filepaths with ../../../ etc. Solves an undefined error in routes/index.js that will be thrown Solves readability problems with routes/index.js through routes/employees/index.js & routes/products/index.js

Proposed Changes

Describe the proposed changes.

Expected Behavior

Filepaths should not throw cannot find... type errors

Steps to Test Solution

  1. In app.js, uncomment ln 6
  2. Run: node app.js
  3. Expecting Error: Route.get() requires a callback function but got a [object Object]