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

all methods on /computers endpoints #95

Closed kenziebottoms closed 6 years ago

kenziebottoms commented 6 years ago

Description

Establishes the following endpoints:

Related Ticket(s)

fixes #56, extends #88, fixes #8

Steps to Test Solution

  1. git checkout kb-computer-post
  2. npm install
  3. comment out non-computer routes
  4. npm run db:generate
  5. npm start
  6. http://localhost:8080/api/v1/computers should give you 25 computers
  7. http://localhost:8080/api/v1/computers/20 should give you
    {
    computer_id: 20,
    mac_address: "42:c6:54:a1:77:3d",
    purchase_date: "2016-04-06T01:32:38.272Z",
    decommission_date: "2017-11-10T14:25:59.680Z"
    }
  8. open Postman or whatever and POST localhost:8080/api/v1/computers
    { "mac_address": "hello",
    "purchase_date": "my name is",
    "decommission_date": "inigo montoya" }
  9. http://localhost:8080/api/v1/computers/25 should now show the above JSON
  10. open Postman or whatever and PUT http://localhost:8080/api/v1/computers/20
    { "mac_address": "hello",
    "purchase_date": "my name is",
    "decommission_date": "inigo montoya" }
  11. http://localhost:8080/api/v1/computers/20 should now also show that JSON
  12. open Postman or whatever and DELETE localhost:8080/api/v1/computers/25
  13. http://localhost:8080/api/v1/computers/25 should now give you a "Computer not found." error
DavidLarsKetch commented 6 years ago

testing

jordan-castelloe commented 6 years ago

testing!

DavidLarsKetch commented 6 years ago

I failed