app.js 693 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Growi::app.js
  3. *
  4. * @package growi
  5. * @author Yuki Takei <yuki@weseek.co.jp>
  6. */
  7. require('module-alias/register');
  8. const logger = require('@alias/logger')('growi');
  9. const growi = new (require('./lib/crowi'))(__dirname, process.env);
  10. /************************************
  11. * Main Process
  12. ***********************************/
  13. process.on('uncaughtException', (err) => {
  14. logger.error('Uncaught Exception: ', err);
  15. });
  16. process.on('unhandledRejection', (reason, p) => {
  17. logger.error('Unhandled Rejection: Promise:', p, 'Reason:', reason);
  18. });
  19. growi.start()
  20. .catch(err => {
  21. logger.error('An error occurred, unable to start the server');
  22. logger.error(err);
  23. });