Sign inSign up

bsmceachern/api-demo-img

By bsmceachern

Updated almost 5 years ago

Image
0

156

bsmceachern/api-demo-img repository overview

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.

  1. install docker image above using this command - docker pull bsmceachern/api-demo-img

  2. install postgres image - docker pull bsmceachern/postgres

  3. configure dbeaver for database a. create new connection - postgreSQL database b. host - localhost c. port # - 5433 d. Username- postgres e. password - password

  4. run postgres container - docker run --name docker_pg -p 5433:5432 -e POSTGRES_PASSWORD=password -d postgres

  5. run api container - docker run -d -p 81:8080 -e SPRING_DATABASE_PASSWORD=password --name apidemo-test-cont-1 api-demo-img

  6. api endpoints a. /api/autos b. /api/autos/{vin} can be used to DELETE, PATCH, and GET(by single VIN)

  7. 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.

Tag summary

Content type

Image

Digest

Size

227.7 MB

Last updated

almost 5 years ago

docker pull bsmceachern/api-demo-img