CurrencyConverter is a .NET-based application designed to facilitate currency conversions. Built with C#, it aims to provide accurate and efficient currency exchange functionalities using free currency rate provider.
- Install .NET9 SDK
- Install Docker
- After docker installed, run command
docker-compose up -d - Then open
appsettings.jsonand change the value ofRedisConnectionwithlocalhost:6379
{
"ConnectionStrings": {
"RedisConnection": "localhost:6379"
}
}- Change directory to WebApi, then type
dotnet run - It will run under
localhost:5000
- Get the token
curl --request GET \
--url http://localhost:5000/api/test-generate-token \
--header 'Content-Type: application/json' \
--header 'User-Agent: your-machine'
- After then the token
curl --request POST \
--url http://localhost:5000/api/currency/conversion \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json' \
--header 'User-Agent: your-machine' \
--data '{
"baseCurrency":"IDR",
"amount":758232,
"ToCurrency":"EUR"
}'
as response
{
"amount": 758232,
"toAmount": 40.94
}- JWT Token
- Rate Limiting Middleware
- Use ProblemDetails RFC 7807 and ExceptionHandler
- Response Time Logging Middleware
