- Java
- Maven
- Spring Boot (Framework)
- MongoDB
- spring-boot-starter-web
- spring-boot-starter-data-mongodb
Checkout the postman Collection documentation
As I have only whitelisted my IP Address in MongoDB, this will not work for you.
-
Open the folder
/Task_1
in your IDE ( I used IntelliJ). -
Open the file
Task_1/src/main/java/com/vishal/kaiburr/KaiburrApplication.java
. -
CLick on the
RUN
button orSHift + F10
. This will start the server.
-
GET servers by Id
http://localhost:8080/server?id={id}
Response contains a JSON of server object with provided id. -
GET servers by Name
http://localhost:8080/server?name={name}
Response contains a JSON of all server objects with provided name. -
GET all servers when no parameter is provided
http://localhost:8080/server
Response contains a JSON of all server objects. -
PUT a server
http://localhost:8080/server
Accept server object in body in json format. This updates the object if it already exist or else add as a new object in the database. -
DELETE server
http://localhost:8080/server?id=3
Deletes a server object with provided ID.
Connect with me on twitter or linkedIn in case if you need any clarification