Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currency converting API is broken #21

Open
aghents opened this issue Jun 25, 2024 · 1 comment
Open

Currency converting API is broken #21

aghents opened this issue Jun 25, 2024 · 1 comment

Comments

@aghents
Copy link

aghents commented Jun 25, 2024

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
Copy link
Author

aghents commented Jun 25, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant