This is a sample employee application which uses Spring Data JPA to interact with H2 database.
- Spring boot
- Maven
- H2 Database
How to Run Build the project by running mvn clean package inside todo-app-parent module Once successfully built, run the service by using the following command:
- AWS Account
- Cloud9 Environment
- Java 8 or higher version
| Application Properties Variables Variable | Value |
|---|---|
| management.endpoints.web.exposure.include | health |
| logging.level.org.springframework | DEBUG |
| logging.level.org.hibernate.SQL | DEBUG |
| server.port | 8085 |
http://localhost:8085/employees/swagger-ui.html
if you don't have access to the swagger via the brower you can use the linux commands to see the API Endpoints which is there for each files
- Get the list of ALl employees
curl -X GET "http://localhost:8085/employees/" -H "accept: */*"
- Add an employee to the Database
curl -X POST "http://localhost:8085/employees/" -H "accept: */*" -H "Content-Type: application/json" -d "{\"employeeId\":0,\"employeeFirstName\":\"string\",\"employeeLastName\":\"string\",\"employeeEmailId\":\"string\"}"
- Update an update to the Database
curl -X PUT "http://localhost:8085/employees/101" -H "accept: */*" -H "Content-Type: application/json" -d "{\"employeeId\":0,\"employeeFirstName\":\"string\",\"employeeLastName\":\"string\",\"employeeEmailId\":\"string\"}"
- Delete an employee from the Database
curl -X DELETE "http://localhost:8085/employees/101" -H "accept: */*"
This interface has various Error Codes
- 200 Created Successfully
- 201 Content Created Successfully
- 204 Content Updated Successfully
- 404 Url not found
- 500 Internal Server Error.There must be some issue while processing
Developed by Suraj