Skip to content

attiliodrei/rustapi

Repository files navigation

rustapi

rustapi

create db

sqlx database setup

DATABASE_URL=sqlite:users.db

Get all User

curl http://localhost:8080/users

Get User by id

curl     http://localhost:8080/users/1

add a User

curl -X POST http://localhost:8080/users \
     -H "Content-Type: application/json" \
     -d '{
         "username": "drei",
         "email": "drei@example.com"
     }'

Delete a User

curl -X DELETE http://localhost:8080/users/1