Write servers in Rust. Because Rust is awesome.
Requirements:
cargo
andrustup
are installed.postgres
is installedrustup install nightly
rustup default nightly
cargo install diesel_cli
pg_ctl start
# press CTRL-c
createdb rocket_demo
cargo run
curl localhost:8000/todos | jq
curl localhost:8000/todos/1 | jq
curl -XPOST localhost:8000/todos -d '{ "text": "Fight the borrow checker", "completed": true }' -H "Content-Type: application/json"
curl -XPATCH localhost:8000/todos/2 -d '{ "text": "Thank the compiler", "completed": true }' -H "Content-Type: application/json"
diesel print-schema > src/schema.rs
diesel migration generate 'create_user_table'
diesel migration run