wikijs-fork/server/index.js
2020-04-19 22:47:02 -04:00

34 lines
825 B
JavaScript

// ===========================================
// Wiki.js
// Licensed under AGPLv3
// ===========================================
const path = require('path')
const { nanoid } = require('nanoid')
let WIKI = {
IS_DEBUG: process.env.NODE_ENV === 'development',
IS_MASTER: true,
ROOTPATH: process.cwd(),
INSTANCE_ID: nanoid(10),
SERVERPATH: path.join(process.cwd(), 'server'),
Error: require('./helpers/error'),
configSvc: require('./core/config'),
kernel: require('./core/kernel')
}
global.WIKI = WIKI
WIKI.configSvc.init()
// ----------------------------------------
// Init Logger
// ----------------------------------------
WIKI.logger = require('./core/logger').init('MASTER')
// ----------------------------------------
// Start Kernel
// ----------------------------------------
WIKI.kernel.init()