Welcome to mirror list, hosted at ThFree Co, Russian Federation.

environment.js « default « frontend « content - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e09a83c4e1805fffbc4dc7c2c4599a29903140aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
 * Utilities for determining site environment.
 */

export const GlHosts = [
  {
    environment: 'production',
    host: 'docs.gitlab.com',
  },
  {
    environment: 'archives',
    host: 'archives.docs.gitlab.com',
  },
  {
    environment: 'review',
    host: 'docs.gitlab-review.app',
  },
  {
    environment: 'local',
    host: 'localhost',
  },
];

export function isGitLabHosted() {
  return GlHosts.some((e) => window.location.host.includes(e.host));
}

export function isArchivesSite() {
  return window.location.host === GlHosts.find((x) => x.environment === 'archives').host;
}

export function isProduction() {
  return window.location.host === GlHosts.find((x) => x.environment === 'production').host;
}