mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-26 01:39:51 +01:00
6 lines
310 B
TypeScript
6 lines
310 B
TypeScript
export function tracingInstanceHost(env: NodeJS.ProcessEnv): string | undefined {
|
|
if (env.PAPERCLIP_TRACING_INSTANCE_HOST !== "true" || !env.PAPERCLIP_PUBLIC_URL) return;
|
|
const url = URL.parse(env.PAPERCLIP_PUBLIC_URL);
|
|
if (url?.protocol === "https:" || url?.protocol === "http:") return url.hostname;
|
|
}
|