MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / isSubdomainbasedRouting

Function isSubdomainbasedRouting

packages/utilities/src/domain.ts:38–69  ·  view source on GitHub ↗
(host: string)

Source from the content-addressed store, hash-verified

36
37// Checks if the routing is subdomain or based on paths
38export const isSubdomainbasedRouting = (host: string): boolean => {
39 if (host.includes('vercel.app')) {
40 return false;
41 }
42 if (host.includes('linendev.com')) {
43 return false;
44 }
45 if (host.includes('www.localhost:3000')) {
46 return false;
47 }
48
49 if (host.includes('.')) {
50 const splitHost = host.split('.');
51 if (splitHost[0] === 'www') {
52 // for cases where user want to use fully qualified name and not subdomain like www.papercups.io
53 if (splitHost[1] !== 'linen') {
54 return true;
55 }
56 return false;
57 }
58 if (host.includes('localhost:3000')) {
59 return true;
60 }
61
62 // handle osquery.fleetdm.com and something.linen.dev
63 if (host.split('.').length > 2) {
64 return true;
65 }
66 }
67
68 return false;
69};
70
71export function isSubdomainNotAllowed(host: string) {
72 return (

Callers 2

domain.test.tsFile · 0.90
rewriteFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected