ReVanced / revanced-website

🌐 Website for ReVanced
https://revanced.app
GNU General Public License v3.0
279 stars 43 forks source link

feat: API status banner #191

Open Ushie opened 8 months ago

Ushie commented 8 months ago

Display a banner at the top of the webpage if the API is down/inaccessible

oSumAtrIX commented 5 months ago

The API is inaccessible if it timeouts or returns anything other than a non-OK response. In both cases, a dedicated banner message should be shown. In addition to the API being down, an offtopic idea can be to cache API responses in case the API is inaccessible.

KTibow commented 5 months ago

From what I understand this isn't a simple change. There is no centralized place or store to check the status from. It might require wrapping every API call or something.

Ushie commented 5 months ago

We have this https://api.revanced.app/v2/ping endpoint which we can use, we can ping it on website initial load and check the status code

If the status code is unexpected, we can display a banner above the navbar

Ushie commented 5 months ago

Seems like the endpoint is currently broken, will open an issue in the API repository

oSumAtrIX commented 5 months ago

The API expects a HEAD request

Ushie commented 5 months ago

Right