NobGit
public anord read

Ledger

Why work hard when you can work easier?

Languages

Repository composition by tracked source files.

TypeScript
TypeScript 86% CSS 10% SQL 3% Shell 1% HTML 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/anord/ledger.git
ssh://[email protected]:2222/orgs/anord/ledger.git
function getOrigin(value: string | undefined | null) {
  if (!value) return null;

  try {
    return new URL(value, typeof window !== "undefined" ? window.location.origin : "http://localhost").origin;
  } catch {
    return null;
  }
}

export function resolveDisplayedMcpEndpoint(fallbackEndpoint?: string) {
  const browserOrigin = typeof window !== "undefined" ? window.location.origin : null;
  const fallbackOrigin = getOrigin(fallbackEndpoint);
  const origin = browserOrigin ?? fallbackOrigin;
  return origin ? `${origin}/mcp` : "/mcp";
}