Closed jordan-castelloe closed 6 years ago
Builds all the get function for Departments data
get
Issue #54
This PR builds the GET functions in the Departments model and controller and hooks them up to routes.
GET
In routes/employees/index.js, comment out all of the function calls EXCEPT line 6: employeesIndexRouter.use(require('./departments'))
routes/employees/index.js
employeesIndexRouter.use(require('./departments'))
In app.js, un-comment the routes variable declaration.
app.js
routes
In app.js, add the line app.use('/api/v1/', routes) after the variable declarations and before the server.
app.use('/api/v1/', routes)
Run node app.js in your terminal to start the server.
node app.js
Go to http://localhost:8080/api/v1/departments. You should see a list of all departments.
http://localhost:8080/api/v1/departments
Go to http://localhost:8080/api/v1/departments/1. You should see the details for department one.
http://localhost:8080/api/v1/departments/1
Description
Builds all the
get
function for Departments dataRelated 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
In
routes/employees/index.js
, comment out all of the function calls EXCEPT line 6:employeesIndexRouter.use(require('./departments'))
In
app.js
, un-comment theroutes
variable declaration.In
app.js
, add the lineapp.use('/api/v1/', routes)
after the variable declarations and before the server.Run
node app.js
in your terminal to start the server.Expected Behavior
Go to
http://localhost:8080/api/v1/departments
. You should see a list of all departments.Go to
http://localhost:8080/api/v1/departments/1
. You should see the details for department one.