Please follow the below instructions for first-time running of the above API. this API can be used to add automobiles to a repository. edit, delete, and grabbing a list of autos are options as well. in order to store autos, you will also need a link for the postgres image, which is provided in the steps below.
install docker image above using this command - docker pull bsmceachern/api-demo-img
install postgres image - docker pull bsmceachern/postgres
configure dbeaver for database a. create new connection - postgreSQL database b. host - localhost c. port # - 5433 d. Username- postgres e. password - password
run postgres container - docker run --name docker_pg -p 5433:5432 -e POSTGRES_PASSWORD=password -d postgres
run api container - docker run -d -p 81:8080 -e SPRING_DATABASE_PASSWORD=password --name apidemo-test-cont-1 api-demo-img
api endpoints a. /api/autos b. /api/autos/{vin} can be used to DELETE, PATCH, and GET(by single VIN)
Postman example to post a vehicle
post method link to use: localhost:81/api/autos payload: { "year":"1967", "make":"Ford", "model":"Mustang", "vin":"AABBCCDD26", "color":"RED" }
after posting you should receive a 200 status. refresh the database in DBeaver to see your new auto added.
Content type
Image
Digest
Size
227.7 MB
Last updated
almost 5 years ago
docker pull bsmceachern/api-demo-img