From cbe726cd000ea5fa2b014ea181007cdee82a66dc Mon Sep 17 00:00:00 2001 From: germondai Date: Sat, 13 Jun 2026 16:30:00 +0200 Subject: [PATCH] feat: add docs URL resolution composable --- apps/web/app/composables/useDocsUrl.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 apps/web/app/composables/useDocsUrl.ts diff --git a/apps/web/app/composables/useDocsUrl.ts b/apps/web/app/composables/useDocsUrl.ts new file mode 100644 index 0000000..c9f2b64 --- /dev/null +++ b/apps/web/app/composables/useDocsUrl.ts @@ -0,0 +1,11 @@ +export function useDocsUrl() { + const url = shallowRef("http://localhost:3001") + + onMounted(() => { + const { protocol, hostname } = window.location + if (hostname === "localhost" || hostname === "127.0.0.1") url.value = "http://localhost:3001" + else url.value = `${protocol}//docs.${hostname}` + }) + + return url +}