This Calculator API is built using Rust with the Actix-web framework. It supports basic arithmetic operations: addition, subtraction, multiplication, and division.
To run this project, you will need Rust installed on your machine. You can install Rust from rust-lang.org.
- Clone the repository:
Clone the project to your local machine. Replace
pshongwewith your actual GitHub username if you have forked or created a repository for this project.git clone https://github.com/pshongwe/calculator_api.git cd calculator_api
cargo runThe API provides four endpoints for basic arithmetic operations: addition, subtraction, multiplication, and division. The operations are performed using query parameters a and b.
- Endpoint:
/add - Method: GET
- Query Parameters:
a: First operand (float)b: Second operand (float)
Example:
curl "http://127.0.0.1:8080/add?a=10&b=5"Result:
15This project is licensed under the MIT License - see the LICENSE file for details.