Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include fallback mechanism in your code to avoid issues #3

Open
fawazahmed0 opened this issue Apr 23, 2022 · 0 comments
Open

Include fallback mechanism in your code to avoid issues #3

fawazahmed0 opened this issue Apr 23, 2022 · 0 comments

Comments

@fawazahmed0
Copy link
Owner

fawazahmed0 commented Apr 23, 2022

This API have multiple fallback urls:

Fallback URL:

https://raw.githubusercontent.com/fawazahmed0/hadith-api/{apiVersion}/{endpoint}

Pseudo code:
For example, if you want to fetch eng-muslim edition

Fetch https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions/eng-muslim.min.json
If above url fails, then try fetching https://cdn.jsdelivr.net/gh/fawazahmed0/hadith-api@1/editions/eng-muslim.json
If above url fails, then try fetching https://raw.githubusercontent.com/fawazahmed0/hadith-api/1/editions/eng-muslim.min.json
If above url fails, then try fetching https://raw.githubusercontent.com/fawazahmed0/hadith-api/1/editions/eng-muslim.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant