Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 927 Bytes

MIGRATION.md

File metadata and controls

18 lines (15 loc) · 927 Bytes

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