Go to file
Hakan Ensari cfbb4ac4ac Repack app
I'm moving my company's server to a private location now that I have sold the domain. While prepping for this, I've done some cleanup and also threw in changes I had lingering on my hard drive.

- Run a single database query instead of two
- Fold the gem into the app and use Ox instead of REXML
- Simplify error handling logic
- Relax throttling
2018-03-08 23:51:36 +00:00
bin Repack app 2018-03-08 23:51:36 +00:00
config Repack app 2018-03-08 23:51:36 +00:00
db/migrate Repack app 2018-03-08 23:51:36 +00:00
lib Repack app 2018-03-08 23:51:36 +00:00
public Repack app 2018-03-08 23:51:36 +00:00
spec Repack app 2018-03-08 23:51:36 +00:00
.dockerignore Repack app 2018-03-08 23:51:36 +00:00
.env.example Repack app 2018-03-08 23:51:36 +00:00
.gitignore Gardening 2017-12-31 16:35:03 +00:00
.rubocop.yml Repack app 2018-03-08 23:51:36 +00:00
.tool-versions Repack app 2018-03-08 23:51:36 +00:00
.travis.yml Repack app 2018-03-08 23:51:36 +00:00
config.ru Repack app 2018-03-08 23:51:36 +00:00
docker-compose.override.yml Repack app 2018-03-08 23:51:36 +00:00
docker-compose.prod.yml Move scheduler back to separate container 2018-01-08 12:12:54 +00:00
docker-compose.yml Move scheduler back to separate container 2018-01-08 12:12:54 +00:00
Dockerfile Repack app 2018-03-08 23:51:36 +00:00
Gemfile Repack app 2018-03-08 23:51:36 +00:00
Gemfile.lock Repack app 2018-03-08 23:51:36 +00:00
LICENSE Remove dates from license 2017-01-03 12:44:13 +00:00
limit_req.conf Repack app 2018-03-08 23:51:36 +00:00
Rakefile Repack app 2018-03-08 23:51:36 +00:00
README.md Repack app 2018-03-08 23:51:36 +00:00

Fixer

Travis

Fixer is a free API for current and historical foreign exchange rates published by the European Central Bank.

Rates are updated around 4PM CET every working day.

Usage

Get the latest foreign exchange rates.

GET /latest

Get historical rates for any day since 1999.

GET /2000-01-03

Rates quote against the Euro by default. Quote against a different currency.

GET /latest?from=USD

Request specific exchange rates.

GET /latest?to=GBP

Change the amount requested.

GET /latest?amount=100

The primary use case is client side. For instance, with money.js in the browser

let demo = () => {
  let rate = fx(1).from("GBP").to("USD")
  alert("£1 = $" + rate.toFixed(4))
}

fetch('https://api.example.com/latest')
  .then((resp) => resp.json())
  .then((data) => fx.rates = data.rates)
  .then(demo)

Installation

To build locally, type

docker-compose up -d

Now you can access the API at

http://localhost:8080

In production, create a .env file and run with

docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d