f47eed74e509d0526a84179920d09d76cf5fafcf
[motion2.git] / server / services / express / index.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 _0x31d6=['createServer','listen','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis'];(function(_0x47b89c,_0x5d2c41){var _0x7174c=function(_0x1ba8f2){while(--_0x1ba8f2){_0x47b89c['push'](_0x47b89c['shift']());}};_0x7174c(++_0x5d2c41);}(_0x31d6,0x1a0));var _0x631d=function(_0x4e1b3a,_0x433b59){_0x4e1b3a=_0x4e1b3a-0x0;var _0x3d7ffc=_0x31d6[_0x4e1b3a];return _0x3d7ffc;};'use strict';var _=require(_0x631d('0x0'));var http=require(_0x631d('0x1'));var express=require(_0x631d('0x2'));var sticky=require('sticky-session');var Redis=require(_0x631d('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x631d('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x631d('0x5')](server,config[_0x631d('0x6')])){var socketio=require(_0x631d('0x7'))(server,{'transports':[_0x631d('0x8'),'polling']});config[_0x631d('0x9')]=_[_0x631d('0xa')](config[_0x631d('0x9')],{'host':_0x631d('0xb'),'port':0x18eb});socketio[_0x631d('0xc')](require(_0x631d('0xd'))({'pubClient':new Redis(config[_0x631d('0x9')]),'subClient':new Redis(config[_0x631d('0x9')])}));require('../../config/triggers')[_0x631d('0xe')]();require('../../config/socketio')['default'](socketio);require(_0x631d('0xf'))[_0x631d('0xe')](app);require(_0x631d('0x10'))[_0x631d('0xe')](app);}else{server[_0x631d('0x11')]('listening',function(){console[_0x631d('0x12')](_0x631d('0x13'),config[_0x631d('0x6')]);});}exports=module[_0x631d('0x14')]=app;