- Introduction and About
- Installation
- Usage
- Credits and Versioning
This is a very basic RESTful API to serve as an introduction to this form of API. The purpose of it is purely for learning the skill of setting up this type of API.
There are very minimal intallation requirements, but there are some dependencies that need to be installed by entering the following command:
yarn install
Once the dependencies have been installed the API should be started by entering the following command:
yarn start
From there it is off to the Postman application to experiment a little bit with the API. The Postman Application can be found at:
It is assumed that the user is competent in the use of the Postman Application.
The API is capable of receiving requests to:
- Get a list of cars back from the API
- Add a car to the list
- Delete a car using its id
- Update the model or number of seats
Simply add the API address into the Postman application and set the GET request up as in the image below:
Change the setting to POST and go to the body section, select raw JSON data and enter the details of the new car in JSON format.
Change the setting to DELETE and end the URL with / followed by the id of the car that needs to be deleted. See an example in the image below:
This method updates any of the properties of any given car, identified by its id. It is done by adding / and the id number to the base url and then adding the property that needs to be amended in the body of the request. Refer to the image below for a clearler description of what must be done on Postman.