feat(api): set default api url with env var

This commit is contained in:
Ax333l 2022-12-23 13:57:56 +01:00
parent 6c0d95baa2
commit 6ea64ef873
No known key found for this signature in database
GPG Key ID: D2B4D85271127D23
4 changed files with 17 additions and 14 deletions

1
.env Normal file
View File

@ -0,0 +1 @@
RV_API_URL="https://releases.revanced.app"

2
.gitignore vendored
View File

@ -4,8 +4,6 @@ node_modules
/public
/.svelte-kit
/package
.env
.env.*
!.env.example
/_docs_src
/static/docs

View File

@ -1,8 +1,9 @@
import { browser } from "$app/environment";
import { browser } from '$app/environment';
import { RV_API_URL } from '$env/static/public';
const URL_KEY = "revanced_api_url";
const URL_KEY = 'revanced_api_url';
export const default_base_url = "https://releases.revanced.app";
export const default_base_url = RV_API_URL;
// Get base URL
export function api_base_url(): string {

View File

@ -14,6 +14,9 @@ const config = {
pages: "public",
fallback: "404.html"
}),
env: {
publicPrefix: "RV"
}
}
};