Scroll down and read the bottom setups first
Using Embedded H2 Database
http://localhost:8081/h2-console/
Rest Endpoints
GET BY PARAM /getproductdetails/{productId}
http://localhost:8081/api/getproductdetails/{productId}
GET ALL, POST, PUT /products
http://localhost:8081/api/products
DELETE /products/{productId}
GET BY PARAM /getconfigdetails/{LaptopId}
GET ALL, POST, PUT /SystemConfig
DELETE /SystemConfig/{LaptopId}
Post
{
"productId": "0982",
"productName": "Coconut oil",
"productPrice": "35"
}
Post {
"laptopId": "1000",
"laptopName": "Lenovo",
"laptopRam": "3" ,
"laptopProcessor":"Intel",
"laptopOS": "WIN10"
}
GET for All /products
[
{
"productId": "0982",
"productName": "Coconut oil",
"productPrice": "35"
},
{
"productId": "6321",
"productName": "Shampoo",
"productPrice": "59"
},
{
"productId": "5433",
"productName": "Zandu balm",
"productPrice": "670"
}
]
| | | Starting the application | | | |______________________________________________________________________________|
Please download the file from github
import the application as existing maven project
run the application as Java application
now to get the values http://localhost:8081/api/products
The Tomcat and H2 DB are embedded within the application
No other installation needed other that Java and Eclipse
[------- nothing happened -------]
if nothing appears instead of going to the earlier link press below link and see while it is in run mode
enter user h2 and press connect
paste the sql statement and run
INSERT INTO PRODUCT (PRODUCT_ID,PRODUCT_NAME , PRODUCT_PRICE ) VALUES ('6321', 'shampoo', '69');
now to get the values http://localhost:8081/api/products