c4d2e2b579ae8c37a1d25d52e76a14039d06c7bb
[motion2.git] / server / app.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xc27d=['./config/pm2/config','./config/schedule','./config/schedule/chat','sync','then','listen','info','start','Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','name','None','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./rpc','./config/logger','app'];(function(_0x43cf72,_0x28f147){var _0x269afc=function(_0x3e7a52){while(--_0x3e7a52){_0x43cf72['push'](_0x43cf72['shift']());}};_0x269afc(++_0x28f147);}(_0xc27d,0x191));var _0xdc27=function(_0x1021d7,_0x26b624){_0x1021d7=_0x1021d7-0x0;var _0x3c73b3=_0xc27d[_0x1021d7];return _0x3c73b3;};'use strict';var _=require('lodash');var mysqldb=require(_0xdc27('0x0'));var rpc=require(_0xdc27('0x1'));var config=require('./config/environment');var logger=require(_0xdc27('0x2'))(_0xdc27('0x3'));var pm2=require('./config/pm2');var pm2Config=require(_0xdc27('0x4'));var schedule=require(_0xdc27('0x5'));var chat=require(_0xdc27('0x6'));function main(){return mysqldb['db']['sequelize'][_0xdc27('0x7')]()[_0xdc27('0x8')](function(){return rpc[_0xdc27('0x9')]();})[_0xdc27('0x8')](function(_0x58f7e3){logger[_0xdc27('0xa')](_0x58f7e3);return chat[_0xdc27('0xb')]();})[_0xdc27('0x8')](function(){return schedule[_0xdc27('0xb')]();})[_0xdc27('0x8')](function(_0x4cbbc2){logger[_0xdc27('0xa')](_0x4cbbc2);return pm2['start'](pm2Config);})[_0xdc27('0x8')](function(_0x31fa11){logger[_0xdc27('0xa')](_0xdc27('0xc'),_[_0xdc27('0xd')](_[_0xdc27('0xe')](_0x31fa11,{'status':_0xdc27('0xf')}),'name')[_0xdc27('0x10')]());logger['info'](_0xdc27('0x11'),_[_0xdc27('0xd')](_['filter'](_0x31fa11,function(_0x17c793){return _0x17c793[_0xdc27('0x12')]!==_0xdc27('0xf');}),_0xdc27('0x13'))[_0xdc27('0x10')]()||_0xdc27('0x14'));config['seedDB']&&require(_0xdc27('0x15'))[_0xdc27('0x16')]();require(_0xdc27('0x17'))[_0xdc27('0x16')]();})[_0xdc27('0x18')](function(_0x1499f2){logger[_0xdc27('0x19')](_0xdc27('0x1a'),_0x1499f2);process['exit'](0x1);});}main();