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

GET functions for departments data #90

Closed jordan-castelloe closed 6 years ago

jordan-castelloe commented 6 years ago

Description

Builds all the get function for Departments data

Related Ticket(s)

Issue #54

Proposed Changes

This PR builds the GET functions in the Departments model and controller and hooks them up to routes.

Steps to Test Solution

  1. In routes/employees/index.js, comment out all of the function calls EXCEPT line 6: employeesIndexRouter.use(require('./departments'))

  2. In app.js, un-comment the routes variable declaration.

  3. In app.js, add the line app.use('/api/v1/', routes) after the variable declarations and before the server.

  4. Run node app.js in your terminal to start the server.

Expected Behavior

  1. Go to http://localhost:8080/api/v1/departments. You should see a list of all departments.

  2. Go to http://localhost:8080/api/v1/departments/1. You should see the details for department one.