MCPcopy Index your code
hub / github.com/AnswerOverflow/AnswerOverflow / getServerHomepageUrl

Function getServerHomepageUrl

packages/ui/src/utils/server.tsx:2–17  ·  view source on GitHub ↗
(server: ServerPublic)

Source from the content-addressed store, hash-verified

1import type { ServerPublic } from '@answeroverflow/api';
2export function getServerHomepageUrl(server: ServerPublic) {
3 if (
4 // eslint-disable-next-line n/no-process-env
5 process.env.NODE_ENV !== 'production' &&
6 !server.customDomain
7 ) {
8 return `/c/${server.id}`;
9 }
10 if (!server.customDomain) {
11 return `https://www.answeroverflow.com/c/${server.id}`;
12 }
13 return `http${
14 // eslint-disable-next-line n/no-process-env
15 process.env.NODE_ENV === 'production' ? 's' : ''
16 }://${server.customDomain}`;
17}
18
19// TODO: Handle this at the API level
20export function getServerDescription(server: ServerPublic) {

Callers 3

ServerInviteTitleFunction · 0.90
ServerCTAFunction · 0.90
ViewServerAboutFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected