A recipe book CRUD API featuring Turso embedded replicas and HonoJs.
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
Install project dependencies:
npm i
In development:
npm run dev
In production:
npm run start
Add a new task:
curl "http://127.0.0.1:8080/todos" \
-X POST \
-H 'Content-Type: application/json' \
-d '{ "recipe": { "name": "Recipe 1", "nutritionInformation": "Vitamin A, Vitamin B", "instructions": "Do abc" }, "ingredients": [{ "name": "ingredient 1", "measurements": "2 cups" }] }'
Get the list of added tasks:
curl "http://127.0.0.1:8080/todos"