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