Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 1012 Bytes

MIGRATION.md

File metadata and controls

19 lines (14 loc) · 1012 Bytes

Migration Guide

  1. 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}

  2. 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]
  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