A Web Service application to convert URLs to deeplinks and deeplinks to URLs.
Application is dockerized and a spring boot - maven - postgres - actuator application.
To run:
docker-compose up --build
To shutdown and cleanup:
docker-compose down
There are two endpoints for this transition.
- web2deep
- deep2web
-
httpTrace endpoint is enabled in our application:
management.endpoints.web.exposure.include=httptraceCould be modified in our application.properties file to disable if necessary.
Request and response traces could be monitored via:
http://localhost:8080/actuator/httptrace/
For project setup, postgresql initilize script is provided. docker-compose already initilize it. In case there is an error, db can be initilized as following:
- cd \LinkTransformer\docker-entrypoint-initdb.d\
- docker network create selin
- docker network ls
- docker run --name selin-db --network selin -p 5432:5432 -e POSTGRES_PASSWORD=Passw0rd -d postgres
done creating the db, next steps are not needed but incase if you want to check anything, you can use postbird or jump into db console by:
- docker exec -it selin-db bash
psql -U postgres -W
... insert password (Passw0rd)
to clean the docker parts after all is well(to shut down database and clean what is left):
- docker rm -f selin-db
- docker network rm selin
(for more info you can check: https://medium.com/@selinkaya.ce/docker-cheatsheet-c3cc7cf83a5c )
Endpoint cases provided below are tested via junit and postman
|
request |
response |
|
https://www.selin.com/casio/saat-p-1925865?boutiqueId=439892&merchantId=105064 |
ty://?Page=Product&ContentId=1925865&CampaignId=439892&MerchantId=105064 |
|
ty://?Page=Product&ContentId=1925865 |
|
|
https://www.selin.com/casio/erkek-kol-saati-p-1925865?boutiqueId=439892 |
ty://?Page=Product&ContentId=1925865&CampaignId=439892 |
|
https://www.selin.com/casio/erkek-kol-saati-p-1925865?merchantId=105064 |
ty://?Page=Product&ContentId=1925865&MerchantId=105064 |
|
ty://?Page=Search&Query=elbise |
|
|
ty://?Page=Search&Query=%C3%BCt%C3%BC |
|
|
ty://?Page=Home |
|
|
ty://?Page=Home |
|
request |
response |
|
ty://?Page=Product&ContentId=1925865&CampaignId=439892&MerchantId=105064 |
https://www.selin.com/brand/name-p-1925865?boutiqueId=439892&merchantId=105064 |
|
ty://?Page=Product&ContentId=1925865 |
|
|
ty://?Page=Product&ContentId=1925865&CampaignId=439892 |
https://www.selin.com/brand/name-p-1925865?boutiqueId=439892 |
|
ty://?Page=Product&ContentId=1925865&MerchantId=105064 |
https://www.selin.com/brand/namei-p-1925865?merchantId=105064 |
|
ty://?Page=Search&Query=elbise |
|
|
ty://?Page=Search&Query=%C3%BCt%C3%BC |
|
|
ty://?Page=Favorites |
|
|
ty://?Page=Orders |