Build a web service that converts amounts between different currencies using fixed exchange rates.
This challenge is tech-agnostic. Choose your preferred programming language and framework. For beginner level, no database required.
- Handle currency conversion logic
- Manage multiple currency pairs
- Provide accurate calculations
-
Environment Setup:
- Programming language and web framework
-
Implementation Details:
- Create a GET endpoint at
/convertthat acceptsamount,from, andtoparameters (e.g., from=USD, to=EUR) - Use fixed exchange rates (e.g., 1 USD = 0.85 EUR)
- Create a GET endpoint at
-
Testing:
- Test with:
GET /convert?amount=100&from=USD&to=EUR
- Test with:
- Fetch real-time rates from an external API
- Support more currencies
- Add historical conversion
By completing this challenge, you will learn to implement financial calculations in web services.
Happy coding!