it's a server for reactive cars, by default it runs on port 4000
$ npm install or $ yarn
$ node db/initDB.js
Execution of this command will generate 10000 car records, and save them to the database
$ npm start or $ yarn start
| Route | HTTP Verb | Description |
|---|---|---|
| / | GET | Get all cars |
| /catalog | GET | get a catalog of cars |
| /show/:id | GET | get a car by id with incremented views field |
| /create | POST | create a new car |
| /read/:id | GET | get a car |
| /update/:id | PUT | update a car |
| /delete/:id | DELETE | get a car |
-
request:
GET /catalogresponse:
{ "Mitsubishi": ["Lancer"], "BMW": ["I6", "X7"] } -
request:
PUT /update/5946448342f6c140084be79arequest body:
{ "manufacturer": "Dodge", "model": "Viper", "year": 2017, "kilometrage": 381, "fuelType": "Gasoline", "engineDisplacement": 4000, "transmissionType": "Manual", "price": 350000, "views": 382, "photos": [ "https://www.mitsubishi-motors.ca/media/vehicle/nav/15LanEvoFE_Titanium-Grey_09_medium.png" ] }response:
{ "_id": "5946448342f6c140084be79a", "manufacturer": "Dodge", "model": "Viper", "year": 2017, "kilometrage": 381, "fuelType": "Gasoline", "engineDisplacement": 4000, "transmissionType": "Manual", "price": 350000, "views": 382, "__v": 0, "photos": [ "https://www.mitsubishi-motors.ca/media/vehicle/nav/15LanEvoFE_Titanium-Grey_09_medium.png" ] }