src/config/server.config.js   A
last analyzed

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 61
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 0
c 2
b 0
f 1
nc 1
dl 0
loc 61
rs 10
ccs 6
cts 6
cp 1
crap 0
wmc 0
mnd 0
bc 0
fnc 0
bpm 0
cpm 0
noi 0
1
/**
2
 * Configurations for server
3
 *
4
 * @since 1.0.0
5
 */
6
7 4
const API_CONTEXT = 'api';
8 4
const API_VERSION = 1;
9
10 4
const DEV_SERVER_PORT = 8080;
11 4
const WEBPACK_SERVER_PORT = 3000;
12
13 4
const configs = {
14
  defaults: {
15
    host: 'localhost',
16
    port: DEV_SERVER_PORT,
17
    mongoDBUrl: 'mongodb://localhost',
18
  },
19
  auth: {
20
    secretKey: 'secretKey',
21
    tokenTTL: 24 * 60 * 60 * 1000,    // in millisecond
22
  },
23
  directory: {
24
    component: 'component',
25
    public: 'dist/public/',
26
  },
27
  url: {
28
    publicPrefix: '/public/assets',
29
    apiPrefix: `/${API_CONTEXT}/v${API_VERSION}`,
30
    statusApiPrefix: `/${API_CONTEXT}/v${API_VERSION}/status`,
31
    statusTypeApiPrefix: `/${API_CONTEXT}/v${API_VERSION}/status-types`,
32
    deviceTypeApiPrefix: `/${API_CONTEXT}/v${API_VERSION}/device-types`,
33
    loginUI: '/login',
34
  },
35
  build: {
36
    sourceDirectory: 'src',
37
    clientEntry: './client.js',
38
    serverEntry: 'index.js',
39
    webpackServerPort: WEBPACK_SERVER_PORT,
40
    clientOutputDirectoryName: 'dist/public',
41
    serverOutputDirectoryName: 'dist',
42
    clientOutputJsFileName: 'client.bundle.js',
43
  },
44
  initialData: {
45
    users: [
46
      {
47
        username: 'admin',
48
        password: 'admin',
49
        role: 'WRITE',
50
        isTemporary: true,
51
      },
52
    ],
53
    deviceTypes: [
54
      { label: 'Android', value: 'android' },
55
      { label: 'iOS', value: 'ios' },
56
      { label: 'Paper', value: 'paper' },
57
      { label: 'Paper Lite', value: 'paper_lite' },
58
      { label: 'PC/Mac', value: 'qt' },
59
    ],
60
    statusTypes: [
61
      { label: '서버 문제', value: 'serviceFailure' },
62
      { label: '정기 점검', value: 'routineInspection' },
63
    ],
64
  },
65
};
66
67
module.exports = configs;
68