Task 1
used springboot for completing task
endpoints
- /add (Add the details to the database)
- /getById (Retrive the data using ID)
- /getByName ( Retrive the Data using name)
- /deleteById (Delete from the Database using ID)
Rest API's postman:
- /addServer
- /findByName
- /findByID
- /deleteByID
Controller: /Server/src/main/java/com/spring/test/controller
Task 3
To Run in docker.
Open terminal
Go to Server/target
And run docker build . -t server
This will create a image of the JAR file.
Now run the docker-compose.yml using docker-compose up.
Now using web Browser at localhost:8086 we can use the endpoints.
Task 2
To create the Swagger API is Used the online edittor. And downloaded the code as Server for Spring. But was unable to make it work. So I Have upload the YAML file which I was able to create.
Screenshots