forked from IBM/nicedoc.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.js
33 lines (28 loc) · 987 Bytes
/
constants.js
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
'use strict'
const url = require('url')
const pkg = require('./package.json')
const { GITHUB_TOKEN, SITE_URL = pkg.homepage, PORT = 3000, NODE_ENV = 'development' } =
process.env || {}
const isDevelopment = NODE_ENV === 'development'
module.exports = {
GITHUB_TOKEN,
REGEX_LOCAL_URL: /^\/(?!\/)/,
REGEX_HTTP_PROTOCOL: /^https?:\/\//i,
REGEX_START_WITH_LETTER_OR_NUMBER: /^[a-z0-9]/i,
SITE_URL: isDevelopment ? 'http://localhost:3000' : SITE_URL,
PORT: parseInt(PORT, 10),
NODE_ENV,
INTERNAL_NEXT_PATHS: ['/_next', '/_webpack/', '/__webpack_hmr', '/static/'],
APP: {
name: pkg.name,
description: pkg.description,
url: SITE_URL,
image: url.resolve(SITE_URL, '/static/banner.jpg'),
logo: url.resolve(SITE_URL, '/static/logo.png'),
favicon: {
ico: url.resolve(SITE_URL, '/static/favicon.ico'),
medium: url.resolve(SITE_URL, '/static/favicon-32x32.png'),
small: url.resolve(SITE_URL, '/static/favicon-16x16.png')
}
}
}