Warmup - Server by Memory
Your job is to use what you have learned and spin up a NodeJs/Express server with a MongoDB that works.
Requirements:
- GET endpoint
/cars
- POST endpoint
/cars
- PUT endpoint
/cars/:carId
- DELETE endpoint
/cars/:carId
- MongoDB name should be
cars
- GET endpoint
/person
- POST endpoint
/person
- PUT endpoint
/person/:personId
- DELETE endpoint
/person/:personId
- Person model should have a relationship to cars owned. You can use embedded documents or ID-based relationships
Person model should have at least these fields:
{
_id: "someuniquemongoid",
name: "Jon",
carsOwned: [{ //relationship - cars owned by person
_id: "someuniquemongoid",
make: "Toyota",
model: "Camry",
year: 2005
engine: "V6"
miles: 124235
}]
}
Car model should have at least these fields:
{
_id: "someuniquemongoid",
make: "Toyota",
model: "Camry",
year: 2005
engine: "V6"
miles: 124235
}