mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
formatting
This commit is contained in:
parent
2d8fa7ee6b
commit
3e9788e617
18
app.js
18
app.js
@ -12,28 +12,22 @@ module.exports = function(config) {
|
|||||||
var router = express.Router(); // eslint-disable-line
|
var router = express.Router(); // eslint-disable-line
|
||||||
var baseUriPath = config.baseUriPath || '';
|
var baseUriPath = config.baseUriPath || '';
|
||||||
|
|
||||||
app.use(favicon(__dirname + '/public/favicon.ico'));
|
|
||||||
|
|
||||||
app.use(validator([]));
|
|
||||||
|
|
||||||
app.set('trust proxy');
|
app.set('trust proxy');
|
||||||
|
app.set('port', config.port);
|
||||||
app.locals.baseUriPath = baseUriPath;
|
app.locals.baseUriPath = baseUriPath;
|
||||||
|
app.use(cookieParser());
|
||||||
|
|
||||||
|
app.use(favicon(__dirname + '/public/favicon.ico'));
|
||||||
|
app.use(validator([]));
|
||||||
|
app.use(baseUriPath, express.static(__dirname + '/public'));
|
||||||
|
app.use(bodyParser.json({ strict: false }));
|
||||||
app.use(log4js.connectLogger(logger, {
|
app.use(log4js.connectLogger(logger, {
|
||||||
format: ':remote-addr :status :method :url :response-timems',
|
format: ':remote-addr :status :method :url :response-timems',
|
||||||
level: 'auto' // 3XX=WARN, 4xx/5xx=ERROR
|
level: 'auto' // 3XX=WARN, 4xx/5xx=ERROR
|
||||||
}));
|
}));
|
||||||
|
|
||||||
app.set('port', config.port);
|
|
||||||
|
|
||||||
app.use(baseUriPath, express.static(__dirname + '/public'));
|
|
||||||
app.use(bodyParser.json({ strict: false }));
|
|
||||||
|
|
||||||
app.use(cookieParser());
|
|
||||||
|
|
||||||
// Setup API routes
|
// Setup API routes
|
||||||
routes.create(router, config);
|
routes.create(router, config);
|
||||||
|
|
||||||
app.use(baseUriPath, router);
|
app.use(baseUriPath, router);
|
||||||
|
|
||||||
return app;
|
return app;
|
||||||
|
Loading…
Reference in New Issue
Block a user