Skip to content

Latest commit

 

History

History
24 lines (14 loc) · 595 Bytes

File metadata and controls

24 lines (14 loc) · 595 Bytes

My follow-along repo for the zero2prod rust book.

dev

run 'cargo watch -x check -x test -x run'

curl -X GET 127.0.0.1:8000/health

db migration

export DATABASE_URL=postgres://postgres:password@127.0.0.1:5432/newsletter sqlx migrate add create_subscriptions_table sqlx migrate run

with psql cli

docker exec -it postgres psql -h "localhost" -U postgres -p 5432 -d postgres -c '\c newsletter' -c '\d+ subscriptions'

test

start pg image: ./scripts/init_db.sh

cargo test

TEST_LOG=TRUE cargo test health_check_works | bunyan