(server: ServerPublic)
| 1 | import type { ServerPublic } from '@answeroverflow/api'; |
| 2 | export 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 |
| 20 | export function getServerDescription(server: ServerPublic) { |
no outgoing calls
no test coverage detected