You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1018 B

  1. // ===========================================
  2. // Wiki.js
  3. // Licensed under AGPLv3
  4. // ===========================================
  5. const path = require('path')
  6. const cluster = require('cluster')
  7. let wiki = {
  8. IS_DEBUG: process.env.NODE_ENV === 'development',
  9. IS_MASTER: cluster.isMaster,
  10. ROOTPATH: process.cwd(),
  11. SERVERPATH: path.join(process.cwd(), 'server'),
  12. configSvc: require('./modules/config'),
  13. kernel: require('./modules/kernel')
  14. }
  15. global.wiki = wiki
  16. process.env.VIPS_WARNING = false
  17. // if (wiki.IS_DEBUG) {
  18. // require('@glimpse/glimpse').init()
  19. // }
  20. wiki.configSvc.init()
  21. // ----------------------------------------
  22. // Init Logger
  23. // ----------------------------------------
  24. wiki.logger = require('./modules/logger').init()
  25. // ----------------------------------------
  26. // Init DB
  27. // ----------------------------------------
  28. wiki.db = require('./modules/db').init()
  29. // ----------------------------------------
  30. // Start Kernel
  31. // ----------------------------------------
  32. wiki.kernel.init()