https://github.com/derklaro/currency-converter
HTTP api that just responds with the current lira status, updated every 30 seconds
https://github.com/derklaro/currency-converter
Last synced: about 2 months ago
JSON representation
HTTP api that just responds with the current lira status, updated every 30 seconds
- Host: GitHub
- URL: https://github.com/derklaro/currency-converter
- Owner: derklaro
- License: mit
- Created: 2023-03-23T15:12:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T02:06:10.000Z (2 months ago)
- Last Synced: 2025-03-19T03:22:06.345Z (2 months ago)
- Language: Rust
- Homepage:
- Size: 115 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Support: supported_currencies.json
Awesome Lists containing this project
README
# Currency Converter Service

A very small application that allows to convert information between multiple currencies. A version of this web
application is available at [https://currency.derklaro.dev](https://currency.derklaro.dev).### Environment variables
1. `BIND`: the address to bind the web server to in form `ip:port` or `[ipv6]:port`.
2. `CURRENCY_API_TOKEN`: an api token for [Fast Forex](https://www.fastforex.io/). The api will be used to fetch the
currency states.### HTTP routes
#### `/status/{base currency}`:
[Try it out](https://currency.derklaro.dev/status/TRY)
Responds with the status of the given currency based on Euro and US-Dollar. The response looks
like: `Status as of 2023-08-30 14:00:16 (UTC): 1 Turkish Lira is equal to 0.03422 Euro, 0.03744 United States Dollar`.Possible response codes are:
| Status | Meaning |
|--------|---------------------------------------------------|
| 200 | Data is available and formatted. |
| 204 | No data is available for the given base currency. |
| 5XX | An error occurred while processing the request. |#### `/status/{base currency}/{target currencies}`:
[Try it out](https://currency.derklaro.dev/status/TRY/SOS,EUR)
Responds with the status of the given currency based on the given other currencies (comma-separated, up to 3 are
supported). The response looks
like: `Status as of 2023-08-30 14:00:16 (UTC): 1 Turkish Lira is equal to 21.28689 Somali Shilling, 0.03422 Euro`.Possible response codes are:
| Status | Meaning |
|--------|---------------------------------------------------|
| 200 | Data is available and formatted. |
| 204 | No data is available for the given base currency. |
| 5XX | An error occurred while processing the request. |### Compile from source
1. Clone this repository
2. If you're on Linux you might need to install `build-essentials`
3. Make sure you have [Cargo installed](https://doc.rust-lang.org/cargo/getting-started/installation.html) and
run `cargo build --release`
4. Take the final file from `target/release/currency-converter[.extension]`