- Change the URL
- https://cdn.jsdelivr.net/gh/fawazahmed0/currency-api@1/{date}/{endpoint}
+ https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@{date}/v1/{endpoint}
- Change
/currencies/{currencyCode}/{currencyCode}
->/currencies/{currencyCode}
- json = fetchJSON(`/currencies/{fromCurrency}/{toCurrency}`)
+ json = fetchJSON(`/currencies/{fromCurrency}`)
- rate = json[toCurrency]
+ 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