Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 8 days ago
JSON representation

A simple Phoenix JSON API application that converts currency.

Awesome Lists containing this project

README

        

# convertex [![Build Status](https://travis-ci.org/wnuqui/convertex.png?branch=master)](https://travis-ci.org/wnuqui/convertex) [![Coverage Status](https://coveralls.io/repos/github/wnuqui/convertex/badge.svg?branch=master)](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"}}
```