A simple yet robust HTTP service that provides basic integer arithmetic operations through a RESTful API. Built with Go's standard library, featuring structured logging and rate limiting.
- Basic arithmetic operations (addition, subtraction, multiplication, division)
- JSON request/response format
- Input validation
- Structured JSON logging
- Rate limiting for all endpoints
| Endpoint | Method | Description |
|---|---|---|
/add |
POST | Add two integers |
/subtract |
POST | Subtract two integers |
/multiply |
POST | Multiply two integers |
/divide |
POST | Divide two integers |
- Clone the repository
git clone https://github.com/yingtu35/GoCalcAPI.git
cd GoCalcAPI- Run the server directly or build the binary
go run cmd/server/main.goor
go build -o GoCalcAPI cmd/server/main.go
./GoCalcAPI- Send a request
curl -X POST http://localhost:8080/add -d '{"a": 1, "b": 2}'- Add suuport for floating-point numbers
- Add support for user authentication
This project is licensed under the MIT License - see the LICENSE file for details.