This template shows how to connect a Postgres database and use it for a simple TODO list app.
- Public routes for creating/fetching notes using a database.
- Rust
- cargo-shuttle
Run the project with shuttle run.
Then run the following curl commands below:
curl -X POST -H 'content-type: application/json' localhost:8000/todos --data '{"note":"My todo"}'
# {"id":1,"note":"My todo"}
curl localhost:8000/todos/1
# {"id":1,"note":"My todo"}Once you're ready to deploy, use shuttle deploy.
- Shuttle connects by default to port 8000 - if you're currently already using something at port 8000, you can add
the
--port <port-number>to theshuttle runcommand to change this. - If you're running locally, don't forget to have Docker installed and running!