unitx-api

Crates.iounitx-api
lib.rsunitx-api
version0.1.0
created_at2025-10-27 09:03:20.613215+00
updated_at2025-10-27 09:03:20.613215+00
descriptionAxum HTTP API for the unitx conversion engine.
homepagehttps://github.com/mrteesoft/unitx
repositoryhttps://github.com/mrteesoft/unitx
max_upload_size
id1902488
size77,436
Tolulope Olaniyan (Mrteesoft)

documentation

https://docs.rs/unitx-api

README

unitx-api

Axum-based HTTP service that exposes the unitx conversion engine. Ships temperature, distance, and live currency endpoints with validation and structured errors.

Running

cargo run -p unitx-api

Optional environment variables:

  • RUST_LOG=unitx_api=debug for verbose logging.
  • No API keys needed; rates come from the public ECB feed.

Sample request

curl -X POST http://localhost:8080/convert/currency \
  -H "Content-Type: application/json" \
  -d '{"value":"100.00","from":"USD","to":"EUR"}'

Response:

{
  "category": "currency",
  "from": "USD",
  "to": "EUR",
  "input": "100.00",
  "output": "92.00"
}

Actual output depends on the live rate returned by the upstream provider.

Commit count: 0

cargo fmt