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