This is an url shortener written in Rust based on the tutorial here and extended to store urls in a PostgreSQL DB
cp .env.example .env
rustup override set nightly
cargo build
docker-compose up -d db
cargo install diesel_cli --no-default-features --features postgres
diesel migration run
cargo run
curl --data "url=https://www.example.com" http://localhost:8000/
Response: J0
curl --data "url=https://www.example.com" --data "name=example" http://localhost:8000/named
Response: example
curl http://localhost:8000/J0
or
curl http://localhost:8000/example