This is a sample Order 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 | 8086 |
- Make sure the AWS Lambda Function has access to all necessary resources in AWS, e.g. CloudWatch
- The interface is good to go!
http://localhost:8086/orders/swagger-ui.html
if you don't have access to the swagger via the brower you can use the linux commands.
- Get the list of ALl employees
curl -X GET "http://localhost:8086/orders/" -H "accept: */*"
- Add an order to the Database
curl -X POST "http://localhost:8086/orders/" -H "accept: */*" -H "Content-Type: application/json" -d "{\"orderId\":0,\"orderName\":\"laptop\",\"orderSite\":\"vodafone.com\",\"employeeId\":101}"
3Get an order for an employee from the Database
curl -X GET "http://localhost:8086/orders/empId/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