Zero To Production In Rust is an opinionated introduction to backend development using Rust.
This repository serves as supplementary material for the book: it hosts snapshots of the codebase of our email newsletter project at end of each chapter.
This branch is a snapshot of the project at the end of Chapter 5.
You'll need to install:
Launch a (migrated) Postgres database via Docker:
./scripts/init_db.sh
cargo build
cargo test
cargo run
In separate terminal
curl -v http://127.0.0.1:8000/health_check
or
curl -v POST --data 'name=le%20guin&email=ursula_le_guin%40gmail.com' 127.0.0.1:8000/subscriptions
docker build --tag zero2prod --file Dockerfile .
docker run -p 8000:8000 zero2prod
docker images zero2prod
Connect doctl to DigitalOcean
doctl auth init
Link GitHub account to DigitalOcean
doctl apps create --spec spec.yaml
List apps on DigitalOcean
doctl apps list
Alternatively: DigitalOcean Dashboard
Update DO app
doctl apps update YOUR-APP-ID --spec=spec.yaml
Working with doctl
doctl --help
doctl apps --help
doctl apps update --help
Get instance_sizes
curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer e7a53616474e591c80758a2d014928d40af916d182aff51683419fc8bb351fa5" "https://api.digitalocean.com/v2/apps/tiers/instance_sizes"