Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / config / express.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 _0xd2d7=['ejs','urlencoded','50mb','json','initialize','express','serve-favicon','method-override','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','set','appPath','join','public','root','client','use','json\x20replacer','split','html'];(function(_0x46c149,_0xf02baf){var _0x265d91=function(_0x141b87){while(--_0x141b87){_0x46c149['push'](_0x46c149['shift']());}};_0x265d91(++_0xf02baf);}(_0xd2d7,0x1b8));var _0x7d2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2d7[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x7d2d('0x0'));var favicon=require(_0x7d2d('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x7d2d('0x2'));var cookieParser=require(_0x7d2d('0x3'));var errorHandler=require(_0x7d2d('0x4'));var path=require(_0x7d2d('0x5'));var passport=require(_0x7d2d('0x6'));var cors=require(_0x7d2d('0x7'));var moment=require(_0x7d2d('0x8'));var config=require(_0x7d2d('0x9'));var db=require(_0x7d2d('0xa'))['db'];exports[_0x7d2d('0xb')]=function(_0x3eb30d){var _0x13f7bb=_0x3eb30d[_0x7d2d('0xc')](_0x7d2d('0xd'));if(_0x13f7bb==='production'){_0x3eb30d[_0x7d2d('0xe')](_0x7d2d('0xf'),path[_0x7d2d('0x10')](config['root'],_0x7d2d('0x11')));}if(_0x13f7bb==='development'||_0x13f7bb==='test'){_0x3eb30d['set']('appPath',path[_0x7d2d('0x10')](config[_0x7d2d('0x12')],_0x7d2d('0x13')));_0x3eb30d[_0x7d2d('0x14')](errorHandler());}_0x3eb30d[_0x7d2d('0xe')](_0x7d2d('0x15'),function(_0xe26b23,_0x147488){if(this[_0xe26b23]instanceof Date){_0x147488=this[_0xe26b23]['toISOString']()[_0x7d2d('0x16')]('.')[0x0]+'Z';}return _0x147488;});_0x3eb30d[_0x7d2d('0x14')](express['static'](_0x3eb30d[_0x7d2d('0xc')](_0x7d2d('0xf'))));_0x3eb30d['set']('views',config[_0x7d2d('0x12')]+'/server/views');_0x3eb30d['engine'](_0x7d2d('0x17'),require(_0x7d2d('0x18'))['renderFile']);_0x3eb30d[_0x7d2d('0xe')]('view\x20engine',_0x7d2d('0x17'));_0x3eb30d[_0x7d2d('0x14')](bodyParser[_0x7d2d('0x19')]({'limit':_0x7d2d('0x1a'),'extended':!![]}));_0x3eb30d['use'](bodyParser[_0x7d2d('0x1b')]({'limit':'50mb'}));_0x3eb30d[_0x7d2d('0x14')](cors());_0x3eb30d[_0x7d2d('0x14')](methodOverride());_0x3eb30d['use'](cookieParser());_0x3eb30d['use'](passport[_0x7d2d('0x1c')]());};