MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / resolveCrawlerRedirect

Function resolveCrawlerRedirect

apps/web/utilities/redirects.ts:5–32  ·  view source on GitHub ↗
({
  isSubdomainbasedRouting,
  communityName,
  channelName,
  settings,
  channel,
}: {
  isSubdomainbasedRouting: boolean;
  communityName: string;
  channelName?: string;
  settings: Settings;
  channel: SerializedChannel;
})

Source from the content-addressed store, hash-verified

3import { appendProtocol } from '@linen/utilities/url';
4
5export function resolveCrawlerRedirect({
6 isSubdomainbasedRouting,
7 communityName,
8 channelName,
9 settings,
10 channel,
11}: {
12 isSubdomainbasedRouting: boolean;
13 communityName: string;
14 channelName?: string;
15 settings: Settings;
16 channel: SerializedChannel;
17}) {
18 let url = buildChannelUrl({
19 isSubdomainbasedRouting,
20 settings,
21 communityName,
22 channelName,
23 channel,
24 });
25
26 return {
27 redirect: {
28 destination: url,
29 permanent: false,
30 },
31 };
32}
33
34export function shouldRedirectToDomain({
35 account,

Callers 2

topicGetServerSidePropsFunction · 0.90

Calls 1

buildChannelUrlFunction · 0.85

Tested by

no test coverage detected