without multistage
docker build -t urlshortner .
with mulitstage
docker build -t urlshortener -f Dockerfile.multistage .
docker run -d -p 8081:8081 urlshortener
or
docker run -d -p 8081:8081 <urlshortener ImageId>
go to any web browser and type http://localhost:8081/home and send request
you will be able to see output like "URL shortner home page"
go to terminal and make http request using curl
curl -X POST -H "Content-Type: application/json" -d "{\"url\": \"http://veryLoNguRl/v1/api/LLongGUrrrLl/8988\"}" http://localhost:8081/shorturl
You will be able to see output like this
{"actualURL":"http://veryLoNguRl/v1/api/LLongGUrrrLl/8988","shortURL":"http://infra.cd/b2hSBS"}
go to terminal and make http request using curl
curl -X POST -H "Content-Type: application/json" -d "{\"url\": \"http://infra.cd/gaYyrp\"}" http://localhost:8081/actualurl
You will be able to see output like this
{"actualURL":"http://veryLoNguRl/v1/api/LLongGUrrrLl/8988","shortURL":"http://infra.cd/gaYyrp"}
integration test code is under devlopment phase
make integration-tests