Ship portal module + /api/social/v1 SQLite backend separate from /community; update README for MiroTalk CSP and test5 as the next development branch. Co-authored-by: Cursor <cursoragent@cursor.com>
22 lines
613 B
TypeScript
22 lines
613 B
TypeScript
/**
|
|
* Portal mounts 游民社区 under `/social`.
|
|
* Standalone deploy: set SOCIAL_BASE="" (or "/") so paths stay root-relative.
|
|
*/
|
|
|
|
export const SOCIAL_BASE = "/social";
|
|
|
|
export function socialPath(path = "/"): string {
|
|
if (!path || path === "/") return SOCIAL_BASE;
|
|
if (
|
|
path.startsWith("http://") ||
|
|
path.startsWith("https://") ||
|
|
path.startsWith("mailto:") ||
|
|
path.startsWith("tel:")
|
|
) {
|
|
return path;
|
|
}
|
|
if (path === SOCIAL_BASE || path.startsWith(`${SOCIAL_BASE}/`)) return path;
|
|
if (path.startsWith("/")) return `${SOCIAL_BASE}${path}`;
|
|
return `${SOCIAL_BASE}/${path}`;
|
|
}
|