Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var express = require('express')
, routes = require('./routes')
, http = require('http')
, path = require('path')
, swig = require('./config/consolidate-swig').swig
, redis = require('redis')
, C
var app = express();
if ('development' == app.get('env')) {
C = console.log
app.set('config', JSON.parse( require('fs').readFileSync('./config/development.json', 'utf8') ) )
require('swig').init({ cache: false, allowErrors: true, filters: {} })
console.log('configuring DEV')
}
if ('production' == app.get('env')) {
C = function(){}
app.set('config', JSON.parse( require('fs').readFileSync('./config/production.json', 'utf8') ) )
require('swig').init({ cache: true, allowErrors: false, filters: {} })
console.log('configuring PROD')
}
app.configure(function(){
app.set('port', process.env.PORT || 3000);
app.engine('html', swig);
app.set('view engine', 'html');
swig.method('configure', function (options){
var _swig = require('swig');
_swig.init(options);
});
exports.init = function (options) {
var swig = require('swig');
swig.init(options);
};
exports.init = function (options) {
swig.init(options);
};
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, http = require('http')
, path = require('path')
, stat = require('./stat')
, config = require('./config')
, swig = require('./swigger').swig
var app = express();
var enable_debug = true;
require('swig').init({ cache: true, allowErrors: false, filters: {} })
app.set('host', config.APP_HOST);
app.set('port', config.APP_PORT);
app.set('views', __dirname + '/views');
app.engine('html', swig);
app.set('view engine', 'html');
app.set('view options', { layout: false });
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
function init() {
if (isInitSwig) return;
store = getEnv();
swig.init({
autoescape: false,
cache: false,
allowErrors: true,
encoding: option.get('encoding'),
filters: store.filters,
root: store.roots,
tzOffset: option.get('tzOffset', 0)
});
isInitSwig = true;
}