https://github.com/vitexus/cnb-cacher
https://github.com/vitexus/cnb-cacher
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/vitexus/cnb-cacher
- Owner: Vitexus
- Created: 2025-01-22T02:40:59.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-22T11:46:17.000Z (over 1 year ago)
- Last Synced: 2025-02-14T22:53:28.546Z (over 1 year ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust Web Service for Currency Exchange Rates
This project is a Rust-based web service that serves currency exchange rates in JSON format. It provides endpoints to retrieve today's and yesterday's exchange rates for various currencies.
## Project Structure
```
rust-web-service
├── src
│ ├── main.rs # Entry point of the application
│ ├── routes
│ │ └── mod.rs # Routing logic for currency endpoints
│ ├── handlers
│ │ └── currency.rs # Logic for fetching and returning currency rates
│ └── utils
│ └── fetch.rs # Utility functions for fetching exchange rate data
├── Cargo.toml # Configuration file for the Rust project
└── README.md # Documentation for the project
```
## Setup Instructions
1. **Clone the repository:**
```
git clone
cd rust-web-service
```
2. **Build the project:**
```
cargo build
```
3. **Run the web service:**
```
cargo run
```
## Usage
- To get today's exchange rate for a specific currency:
```
GET /today/{CURRENCY_CODE}.json
```
- To get yesterday's exchange rate for a specific currency:
```
GET /yesterday/{CURRENCY_CODE}.json
```
Replace `{CURRENCY_CODE}` with the appropriate currency code (e.g., USD, EUR).
## Dependencies
This project uses several dependencies specified in the `Cargo.toml` file. Make sure to check it for any additional setup required.
## License
This project is licensed under the MIT License. See the LICENSE file for more details.