https://github.com/wnuqui/convertex
A simple Phoenix JSON API application that converts currency.
https://github.com/wnuqui/convertex
convert-currency elixir json-api phoenix
Last synced: about 1 month ago
JSON representation
A simple Phoenix JSON API application that converts currency.
- Host: GitHub
- URL: https://github.com/wnuqui/convertex
- Owner: wnuqui
- Created: 2017-08-28T05:23:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-02T21:59:42.000Z (over 8 years ago)
- Last Synced: 2025-01-19T11:42:17.911Z (over 1 year ago)
- Topics: convert-currency, elixir, json-api, phoenix
- Language: Elixir
- Size: 49.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# convertex [](https://travis-ci.org/wnuqui/convertex) [](https://coveralls.io/github/wnuqui/convertex?branch=master)
A simple Phoenix JSON API application that converts currency. This is a direct port of [konverter](https://github.com/wnuqui/konverter), a Rails application.
## Specifications
- [x] Convert currency to another currency using Google
- [x] Save/cache conversion for the next 60 seconds
- [x] After 60 seconds, convert using Google again
## Sample Usage
Simple `curl` command to convert **USD** to **PHP**.
```bash
# curl command
$ curl -s -X "POST" "http://localhost:4000/api/conversions" \
-H "Content-Type: application/json" \
-d "{\"base\":\"USD\",\"amount\":\"1\",\"target\":\"PHP\"}"
# response
# {"data":{"conversion":"1 US dollar = 51.0740 Philippine pesos"}}
```