-
Change the URL from
https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/{date}/{endpoint}
to
https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@{date}/v1/{endpoint}
-
There is no
/currencies/{currencyCode}/{currencyCode}
endpoint in this new API, so please only use/currencies/{currencyCode}
endpoint. For example:
json = fetchJSON(`/currencies/{fromCurrency}/{toCurrency}`)
rate = json[toCurrency]
becomes
json = fetchJSON(`/currencies/{fromCurrency}`)
rate = json[fromCurrency][toCurrency]
- (Optional Step) Add Fallback mechanism in your code, to avoid any issue in the future.
Refer Readme for URL examples and refer this to know why migration was necessary