thompsonemerson / moeda

:moneybag: :chart_with_upwards_trend: A foreign exchange rates and currency conversion using CLI
MIT License
139 stars 21 forks source link

Currency converting API is broken #21

Open aghents opened 2 weeks ago

aghents commented 2 weeks ago

Steps to reproduce

Clone repo and install dependencies

$ npm install -g moeda

Use moeda as cli tool

Try to use the api

moeda 1 usd brl

Expected behavior

it should convert currency correctly using api

Actual behavior

Error GBP Converting currency... /opt/homebrew/lib/node_modules/moeda/node_modules/got/index.js:73 ee.emit('error', new got.RequestError(err, opts)); ^ ErrorClass [RequestError]: getaddrinfo ENOTFOUND api.ratesapi.io at ClientRequest. (/opt/homebrew/lib/node_modules/moeda/node_modules/got/index.js:73:21) at Object.onceWrapper (node:events:629:26) at ClientRequest.emit (node:events:514:28) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:514:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { code: 'ENOTFOUND', host: 'api.ratesapi.io', hostname: 'api.ratesapi.io', method: 'GET', path: '/api/latest?base=USD&symbols=EUR,GBP,BRL' }

System configuration

Node version: v20.5.1 npm version: 9.8.0 moeda version: 2.0.0 (latest)

aghents commented 2 weeks ago

It would be interesting to fix this issue using the following Open source API which is updated weekly and updates currency daily

https://github.com/fawazahmed0/exchange-api