Skip to content

Include fallback mechanism in your code to avoid issues #3

Open
@fawazahmed0

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions