This project is a simple CRUD (Create, Read, Update, Delete) REST API implemented in Rust and PostgreSQL as the database. It provides endpoints to manage users in the database.
- Create: Add new users to the database.
- Read: Retrieve user information either individually or all users.
- Update: Modify existing user information.
- Delete: Remove users from the database.
Before running this application, ensure you have the following installed:
- Clone this repository:
git clone https://github.com/Kernel-rb/rust-crud-rest-api.git && cd rust-crud-rest-api
- Build the Docker container:
docker-compose build
- Start the Docker container:
docker compose up rustapp
- The API server should now be running. You can access it at http://localhost:8080.
- POST /users: Create a new user.
- GET /users/:id: Retrieve a user by ID.
- GET /users: Retrieve all users.
- PUT /users/:id: Update a user by ID.
- DELETE /users/:id: Delete a user by ID
You can interact with the API using tools like curl or Postman