feat: add docs URL resolution composable

This commit is contained in:
germondai
2026-06-13 16:30:00 +02:00
parent c3ca70047a
commit cbe726cd00
+11
View File
@@ -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
}