- This is a JAX RS maven project created using GlassFish jersey-quickstart-webapp archetype and run on Apache Tomcat server in Eclipse IDE.
- DB layer is DynamoDB local running in localhost. port no 8001.
- The required dependencies (Jersey, JSON support in Jersey, AWS DynamoDb local) are added in pom.xml.
- The DB server can be started using AWS toolkit from eclipse or through CLI by executing the downloadable version of DynamoDB local jar. The endpoint and region are given while instantiating the client in java. command: java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -port 8001 -sharedDb — DynamoDB Local note: -sharedDb — DynamoDB Local will use a single database file, instead of using separate files for each credential and region DynamoDB Local clients will interact with the same set of tables regardless of their region and credential configuration
- Once the Db server is up and running, tables are created and data is inserted through DynamoDB JavaScript Console in http://localhost:8001/shell/. The scripts are saved under FoodAPI/data.
http://localhost:8080/FoodAPI/webapi/restaurant
http://localhost:8080/FoodAPI/webapi/restaurant/1
curl -vX POST http://localhost:8080/FoodAPI/webapi/restaurant/ -d @(data/restaurants/restaurant6.json) \ --header "Content-Type: application/json"
http://localhost:8080/FoodAPI/webapi/restaurant/delete/1
http://localhost:8080/FoodAPI/webapi/restaurant/delete/menu/1
http://localhost:8080/FoodAPI/webapi/Restaurant/delete/menuitems/111
http://localhost:8080/FoodAPI/webapi/menu
http://localhost:8080/FoodAPI/webapi/menu/1
curl -vX POST http://localhost:8080/FoodAPI/webapi/menu -d @(data/menu/menu31.json) \ --header "Content-Type: application/json"
http://localhost:8080/FoodAPI/webapi/menu/delete/11
http://localhost:8080/FoodAPI/webapi/menu/delete/menu/11
http://localhost:8080/FoodAPI/webapi/menuitem
http://localhost:8080/FoodAPI/webapi/menuitem/111
curl -vX POST http://localhost:8080/FoodAPI/webapi/menuitem -d @(data/menuitems/menuitem211.json) \ --header "Content-Type: application/json"
http://localhost:8080/FoodAPI/webapi/menuitem/delete/111