Skip to content

This is small REST-service which can convert some amount from on currency to another.

Notifications You must be signed in to change notification settings

shooom/currency_converter_service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Currency converter

This is small REST-service which can convert some amount from on currency to another.

Main dependencies

#Notes about exchangeratesapi.io free plan

If you use the free plan on exchangeratesapi.io, you coundn't change base currency. And the base currency is EUR.

How to build the app

gradle shadowJar - was builded an build/libsConverterApp-fat.jar

How to run the app

At first, you need to set some environment variables:

  • EX_RATE_ACCESS_KEY - your access_key for exchangeratesapi.io (doesn't have default value)
  • EX_RATE_API_URL - the url exchangeratesapi.io (http://api.exchangeratesapi.io/v1/ as default)
  • CONVERTER_APP_PORT - port of the application (8090 as default)

Then just run the next command:

    java -jar build/libs/ConverterApp-fat.jar

How to check that converter works

    curl --request GET \
  --url 'http://localhost:8090/converter/convert?source=EUR&target=RUB&monetary=100'

The result of the request will looks like

    {
      "source": "EUR",
      "target": "RUB",
      "rate": "82.668491",
      "amountSource": "100",
      "amountResult": "8266.85"
    }

About

This is small REST-service which can convert some amount from on currency to another.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages