Skip to content

airpdev/cloudflare_turso_rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

workers-rs-tursodb

Updated from the example https://github.com/cloudflare/workers-rs

Todo List

A todo list example featuring Turso and Cloudflare worker.

Development

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 .dev.vars file next to your wrangler.toml:

LIBSQL_CLIENT_URL=
LIBSQL_CLIENT_TOKEN=

Run project

npx wrangler dev

Add a new task:

curl "http://localhost:8787/todos" \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"task": "Do task m"}'

Get the list of added tasks:

curl "http://localhost:8787/todos"
npx wrangler deploy
curl https://cloudflare-worker-rs-turso.petar-vasilev0727.workers.dev/todos

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published