Dough Git

clove/pkviewer

web/src/lib/config.ts

back to web/src/lib

/* web/src/lib/config.ts */
import { env } from "$env/dynamic/public";

/**
 * Web-tier configuration that is safe on both server and client.
 *
 * The deployment origin is read at runtime so moving hosts is an env change,
 * not a rebuild (decision 1). The internal API origin lives in
 * $lib/server/api.ts and never reaches the browser.
 */
export const site = {
  /** The one user-facing origin: /, /login, /auth, /manage and /s all live here. */
  get publicOrigin(): string {
    return (env.PUBLIC_ORIGIN || "http://system.localhost:3000").replace(/\/+$/, "");
  },

  /**
   * Where the documentation lives. Hardcoded: it is not pkviewer's host but a
   * fixed destination pkviewer links to, like a repository URL. Its footer is
   * also the route to support.
   */
  docsUrl: "https://docs.doughmination.gay",
};