feat: Allow specifying an Onion API host URL

This commit is contained in:
Jesse Wierzbinski 2024-06-25 18:53:44 -10:00
parent b2989e898e
commit 7b13265d47
No known key found for this signature in database
3 changed files with 10 additions and 0 deletions

View file

@ -1,3 +1,10 @@
export const useBaseUrl = () => {
// Check if running on Onion URL
if (useRequestURL().hostname.endsWith(".onion")) {
return ref(
useRuntimeConfig().public.onionApiHost ?? useRequestURL().origin,
);
}
return ref(useRuntimeConfig().public.apiHost ?? useRequestURL().origin);
};