0
0
mirror of https://github.com/fawazahmed0/exchange-api.git synced 2025-06-29 18:21:14 +00:00
exchange-api/MIGRATION.md
2024-10-18 08:21:39 +05:30

927 B

Migration Guide

  1. 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}
  1. Change /currencies/{currencyCode}/{currencyCode} -> /currencies/{currencyCode}
- json = fetchJSON(`/currencies/{fromCurrency}/{toCurrency}`)
+ json = fetchJSON(`/currencies/{fromCurrency}`)
- rate = json[toCurrency]
+ rate = json[fromCurrency][toCurrency]
  1. (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