65fafb4f2746e2955fdb23baf409f2d892fba794
[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 _0x2fe7=['redis','defaults','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2fe7,0x94));var _0x72fe=function(_0x12c90c,_0x4fd96c){_0x12c90c=_0x12c90c-0x0;var _0x17d36e=_0x2fe7[_0x12c90c];return _0x17d36e;};'use strict';var _=require(_0x72fe('0x0'));var http=require(_0x72fe('0x1'));var express=require(_0x72fe('0x2'));var sticky=require(_0x72fe('0x3'));var Redis=require(_0x72fe('0x4'));var config=require(_0x72fe('0x5'));var app=express();var server=http[_0x72fe('0x6')](app);server[_0x72fe('0x7')]=0xdbba0;if(sticky[_0x72fe('0x8')](server,config[_0x72fe('0x9')])){var socketio=require(_0x72fe('0xa'))(server,{'transports':[_0x72fe('0xb'),_0x72fe('0xc')]});config[_0x72fe('0xd')]=_[_0x72fe('0xe')](config[_0x72fe('0xd')],{'host':'localhost','port':0x18eb});socketio[_0x72fe('0xf')](require(_0x72fe('0x10'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x72fe('0xd')])}));require(_0x72fe('0x11'))[_0x72fe('0x12')]();require(_0x72fe('0x13'))[_0x72fe('0x12')](socketio);require(_0x72fe('0x14'))[_0x72fe('0x12')](app);require(_0x72fe('0x15'))[_0x72fe('0x12')](app);}else{server[_0x72fe('0x16')]('listening',function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x72fe('0x9')]);});}exports=module['exports']=app;