mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: ✨ Allow specifying an Onion API host URL
This commit is contained in:
parent
b2989e898e
commit
7b13265d47
3 changed files with 10 additions and 0 deletions
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue