web/config/default.js   A
last analyzed

Complexity

Total Complexity 6
Complexity/F 1

Size

Lines of Code 75
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 48
mnd 0
bc 0
fnc 6
dl 0
loc 75
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10
1
const defer = require('config/defer').deferConfig
2
3
/**
4
 * Access config by:
5
 * 1. import { config } from 'nuxt-config'
6
 * 2. this.$config.api.url
7
 * 3. ctx.app.$config.api.url
8
 */
9
10
const config = {
11
  server: {
12
    host: '0.0.0.0',
13
    port: 3000,
14
    // Map some frontend paths to WP
15
    proxy: [
16
      '/feed'
17
    ]
18
  },
19
  wp: {
20
    customRoutes: [
21
      {
22
        extension: 'rsl/v1',
23
        route: '/site',
24
        name: 'site'
25
      },
26
      {
27
        extension: 'rsl/v1',
28
        route: '/vote/(?P<action>[\\w\\-\\_]+)',
29
        name: 'vote'
30
      },
31
      {
32
        extension: 'acf/v3',
33
        route: '/options/(?P<id>[\\w-_]+)',
34
        name: 'options'
35
      }
36
    ]
37
  },
38
  api: {
39
    url: 'http://rsl.local',
40
    path: '/api'
41
  },
42
  rsl: {
43
    name: 'RSL 賽事聯盟',
44
    url: 'http://localhost:3000',
45
    cover: {
46
      season1: defer(self => self.rsl.url + '/RSL_cover_s1.png'),
47
      season2: defer(self => self.rsl.url + '/RSL_cover_s2.png'),
48
      kart15th: defer(self => self.rsl.url + '/RSL_cover_kart15th.png'),
49
      season3: defer(self => self.rsl.url + '/RSL_cover_s3.png')
50
    },
51
    ga: 'G-PL45T2HMK3',
52
    facebook: {
53
      url: 'https://www.facebook.com/RSLeagueTW',
54
      username: 'RSLeagueTW'
55
    },
56
    youtube: {
57
      url: 'https://www.youtube.com/RSLeague?sub_confirmation=1',
58
      username: 'RSLeague'
59
    },
60
    twitch: {
61
      url: 'https://www.twitch.tv/RSLeague',
62
      username: 'RSLeague'
63
    },
64
    discord: {
65
      url: 'https://dc.rsl.tw'
66
    }
67
  },
68
  // Whitelist for client to use
69
  client: {
70
    api: defer(self => self.api),
71
    rsl: defer(self => self.rsl)
72
  }
73
}
74
75
module.exports = config
76