diff options
Diffstat (limited to 'src/lib/Utility')
| -rw-r--r-- | src/lib/Utility/proxy.ts | 4 | ||||
| -rw-r--r-- | src/lib/Utility/root.ts | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/Utility/proxy.ts b/src/lib/Utility/proxy.ts index ec9c289b..3337fe29 100644 --- a/src/lib/Utility/proxy.ts +++ b/src/lib/Utility/proxy.ts @@ -1,7 +1,7 @@ import { env } from '$env/dynamic/public'; -export const proxy = (url: string, disable = true) => - env.PUBLIC_ANILIST_REDIRECT_URI?.includes('192.168') && !disable +export const proxy = (url: string, enable = false) => + env.PUBLIC_ANILIST_REDIRECT_URI?.includes('localhost') || enable ? url : `https://proxy.due.moe/?q=${url}`; diff --git a/src/lib/Utility/root.ts b/src/lib/Utility/root.ts new file mode 100644 index 00000000..3f9ea07d --- /dev/null +++ b/src/lib/Utility/root.ts @@ -0,0 +1,8 @@ +import { env } from '$env/dynamic/public'; + +export const root = (path: string, enable = false) => + env.PUBLIC_ANILIST_REDIRECT_URI?.includes('localhost') || enable + ? `http://localhost:5173${path}` + : `https://due.moe${path}`; + +export default root; |