A todo list example made with Rocket and Turso.
Create a turso database.
turso db create <db-name>
Get the database credentials:
# db url
turso db show --url <db-name>
# authentication token
turso db tokens create <db-name>
Store the credentials inside a .env
file:
TURSO_DATABASE_URL
TURSO_AUTH_TOKEN
cargo run
Add a new task:
curl "http://127.0.0.1:3000/todos" \
-X POST \
-H 'Content-Type: application/json' \
-d '{"task": "Do task m"}'
Get the list of added tasks:
curl "http://127.0.0.1:3000/todos"