Skip to content

Latest commit

 

History

History
43 lines (32 loc) · 966 Bytes

File metadata and controls

43 lines (32 loc) · 966 Bytes
curl --location 'http://localhost:8080/v1/shorten' \
--header 'Content-Type: application/json' \
--data '{
    "longUrl": "https://www.bing.com/search?qs=LT&pq=Rust+google&sk=CSYN1&sc=16-11&q=rust+google&cvid=a826e335a74f4217898d8dae1a259447&gs_lcrp=EgRlZGdlKgYIABAAGEAyBggAEAAYQDIGCAEQRRg5MgYIAhAAGEAyBggDEAAYQDIGCAQQABhAMgYIBRAAGEAyBggGEAAYQDIGCAcQABhAMgYICBAAGEDSAQgxNzk4ajBqNKgCCLACAQ&FORM=ANAB01&PC=U531"
}'
curl --location 'http://localhost:8080/<short url path>'
curl --location 'http://localhost:8080/v1/all'

Swagger page:

http://localhost:8080/swagger-ui/

cargo run -r

Docker:

docker build -t url_shortener_rust .

docker run --name url_shortener_rust_container url_shortener_rust
docker run -d --name url_shortener_rust_container url_shortener_rust

Remove all containers:

docker rm -f $(docker ps -aq)
docker system prune -af

  • URLs expire after 30 minutes