Springboot app that has CRUD functionality on an Array List of object Fruit
Each Fruit
object in the Array List consists of the following
id
(integer like 1, 2, 3)name
(string like 'apple', 'banana', 'watermelon')weight
(integer like 5, 10, 20)
Base path - http://localhost:8800
- GET
/hello
: responds with Hello to indicate that the server and app have started properly - GET
/fruits
: list of all fruits (3 fruits will be added by default when the application loads) - GET
/fruit/{id}
: returns fruit object based on given id - POST
/fruit
: adds the given fruit to the fruit's list (payload is mandatory) - PUT
/fruit/{id}
: updates the given based on id (payload is mandatory) - DELETE
/fruit/{id}
: deletes the fruit from the list based on the id - HEALTH -
/health
: responds with "Health - OK" and HTTP status code of 200 (OK) - SERVER-INFO -
/server-info
: gives active port number, Device IP address and Device MAC Address - HARDWARE-INFO -
/hardware-info
: gives used & total RAM (with %), used and total Disk Space (with %) and CPU Utilization % - EMPTY ENDPOINT -
/
: gives back the URL to Swagger Documentation for User to view all of the available Endpoints
The Default server port is set to 8800
Simply download and import the following Collection file in your Postman and it is good to go
-
Swagger UI URL: http://localhost:8800/swagger-ui/#/
-
Swagger base package defined in
-
Swagger Configuration