-
-
Notifications
You must be signed in to change notification settings - Fork 154
/
web.js
35 lines (34 loc) · 939 Bytes
/
web.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const i18n = require('../helpers/i18n');
const logger = require('../helpers/logger');
const passport = require('../helpers/passport');
const routes = require('../routes');
const env = require('./env');
const cookieOptions = require('./cookies');
const koaCashConfig = require('./koa-cash');
const config = require('.');
module.exports = (client) => ({
routes: routes.web,
logger,
i18n,
cookies: cookieOptions,
meta: config.meta,
views: config.views,
passport,
koaCash: env.CACHE_RESPONSES ? koaCashConfig(client) : false,
// temp disable until headers already sent error in koa-redirect-loop is fixed
redirectLoop: false,
cacheResponses: env.CACHE_RESPONSES
? {
routes: [
'/css/(.*)',
'/img/(.*)',
'/js/(.*)',
'/fonts/(.*)',
'/browserconfig(.*)',
'/robots(.*)',
'/site(.*)',
'/favicon(.*)'
]
}
: false
});