You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The website provides a download page for ReVanced Manager. The API returns a list of tools. Because the API can be changed, the tool names can also be changed. The website would not know, which tool to provide as a download. In other words, the website is the end application that has to break agnostics, but can not as of now.
Solution
Add a configuration to the website. The configuration would specify, which tool to provide as a download, which support links to highlight and similar. In the scenario above, an example configuration could look like this:
{
"download": "revanced-manager"
}
The configuration would specify the tool named "revanced-manager" as a download. The name would be used to find the download link from the APIs response list of tools the following way:
api.tools[configuration.download].download
Additional context
It may be useful, to add a frontend to the website, similarly to the API configuration in the same location as the API configuration, as the configuration is client side. This would also be useful, because if someone intends to change the API url, they might also need to update the websites configuration to match the API. For example the API might only include a tool named "some-tool", so as a download the website would provide the download link to "some-tool".
Since the API configuration uses the API url specified in the .env file by default, the site configuration must also originate from the .env file. At build time, the configuration can then be generated from the .env file. In other words, the default values for the site configuration should not be hardcoded into the source code, just like the API url isn't.
The text was updated successfully, but these errors were encountered:
Issue
The website provides a download page for ReVanced Manager. The API returns a list of tools. Because the API can be changed, the tool names can also be changed. The website would not know, which tool to provide as a download. In other words, the website is the end application that has to break agnostics, but can not as of now.
Solution
Add a configuration to the website. The configuration would specify, which tool to provide as a download, which support links to highlight and similar. In the scenario above, an example configuration could look like this:
The configuration would specify the tool named "revanced-manager" as a download. The name would be used to find the download link from the APIs response list of tools the following way:
api.tools[configuration.download].download
Additional context
.env
file by default, the site configuration must also originate from the.env
file. At build time, the configuration can then be generated from the.env
file. In other words, the default values for the site configuration should not be hardcoded into the source code, just like the API url isn't.The text was updated successfully, but these errors were encountered: