mirror of
https://github.com/notrab/dumbo.git
synced 2025-01-17 14:18:14 +01:00
Turso Example
This example demonstrates how to use Turso HTTP with Dumbo to build a simple CRUD API.
Running the Example
-
Install dependencies:
composer install
-
Start the server:
composer start
-
Get all users:
curl http://localhost:8000/users
-
Get a specific user (replace 1 with the desired user ID):
curl http://localhost:8000/users/1
-
Create a new user:
curl -X POST http://localhost:8000/users \ -H "Content-Type: application/json" \ -d '{"name": "John Doe", "email": "john@example.com"}'
-
Update a user (replace
1
with the desired user ID):curl -X PUT http://localhost:8000/users/1 \ -H "Content-Type: application/json" \ -d '{"name": "John Updated", "email": "john.updated@example.com"}'
-
Delete a user (replace
1
with the desired user ID):curl -X DELETE http://localhost:8000/users/1