-
Notifications
You must be signed in to change notification settings - Fork 4
/
config.ts
34 lines (31 loc) · 1.05 KB
/
config.ts
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
import path from 'path';
const host = process.env.HOST || 'http://127.0.0.1:3000';
const isProduction = process.env.NODE_ENV === 'production';
const isBuildingDocs = process.env.NODE_ENV === 'build-docs';
const publicPath = process.env.PUBLIC_PATH || '/api';
const docsPath = path.resolve(__dirname, 'docs');
const buildPath = isProduction
? path.resolve(__dirname)
: path.resolve(__dirname, 'build');
const databaseDirectory = buildPath; // FIXME?
const databaseName = 'database.sqlite';
const indexDirectory = path.resolve(buildPath, 'indices');
const articlesIndexName = 'articlesIndex.json';
const buildImagesPath = path.resolve(buildPath, 'images');
export default {
host,
isProduction,
isBuildingDocs,
buildPath,
buildImagesPath,
docsPath,
articlesPath: path.join(docsPath, 'article'),
videosPath: path.join(docsPath, 'video'),
publicPath,
indexDirectory,
articlesIndexName,
articlesIndexPath: path.join(indexDirectory, articlesIndexName),
databaseDirectory,
databaseName,
databasePath: path.join(databaseDirectory, databaseName)
};