Built motion from commit 3c2ce842.|2.6.31
[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 _0x68d5=['lodash','http','express','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0xfcf20,_0x5f1747){var _0x5697e3=function(_0x2e325d){while(--_0x2e325d){_0xfcf20['push'](_0xfcf20['shift']());}};_0x5697e3(++_0x5f1747);}(_0x68d5,0x1a4));var _0x568d=function(_0x104b43,_0x46c28d){_0x104b43=_0x104b43-0x0;var _0x140fa5=_0x68d5[_0x104b43];return _0x140fa5;};'use strict';var _=require(_0x568d('0x0'));var http=require(_0x568d('0x1'));var express=require(_0x568d('0x2'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x568d('0x3')])){var socketio=require(_0x568d('0x4'))(server,{'transports':[_0x568d('0x5'),_0x568d('0x6')]});config[_0x568d('0x7')]=_[_0x568d('0x8')](config[_0x568d('0x7')],{'host':_0x568d('0x9'),'port':0x18eb});socketio[_0x568d('0xa')](require('socket.io-redis')({'pubClient':new Redis(config[_0x568d('0x7')]),'subClient':new Redis(config['redis'])}));require(_0x568d('0xb'))[_0x568d('0xc')]();require(_0x568d('0xd'))[_0x568d('0xc')](socketio);require(_0x568d('0xe'))[_0x568d('0xc')](app);require(_0x568d('0xf'))[_0x568d('0xc')](app);}else{server[_0x568d('0x10')](_0x568d('0x11'),function(){console[_0x568d('0x12')](_0x568d('0x13'),config[_0x568d('0x3')]);});}exports=module['exports']=app;