Description
This example shows how to make a simple TODO app using Rocket and a shared Shuttle Postgres DB. The following routes are provided:- GET
/todo/<id>
- Get a to-do item by ID. - POST
/todo
- Create a to-do item. Takes “note” as a JSON body parameter.
shuttle
CLI installed):
Code
Usage
Once you’ve cloned the example, try launching it locally usingshuttle run
. Once you’ve verified that it runs successfully, try using cURL in a new terminal to send a POST request:
- Add update and delete routes
- Add static files to show your records
If you want to explore other frameworks, we have more examples with popular ones like Tower and Warp. You can find them right here.
Be sure to check out the examples repo for many more examples!