Have docker installed
Clone my repository to your local machine git clone github.com/mishaRomanov/test-ozon
Go to cloned directory and run with docker compose
docker compose up -d
Go to docker-compose.yml and find environmental variable STORAGE Set it to either postgres or cache
To make link shorter use POST method on /link/add endpoint:
curl --location 'localhost:8080/link/add'\ --header 'Content-Type: application/json' \ --data '{"url":"google.com"}'
Which returns a new link
New link generated: localhost:8080/link/Nm_5MWFiYz
To get your old link back, you make a GET request to /link/your_link endpoint
curl --location 'localhost:8080/link/NjA2NjkyZT'
And it returns you full link in JSON
"google.com"
Also feel free to use /about
endpoint to get all the information you need to test the app.