-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.js
32 lines (28 loc) · 928 Bytes
/
controller.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
const kProofServiceWorkerVersionID = Date.now().toString();
const OLSKServiceWorker = require('./node_modules/OLSKServiceWorker/main.js');
exports.OLSKControllerRoutes = function() {
return [{
OLSKRoutePath: '/',
OLSKRouteMethod: 'get',
OLSKRouteSignature: 'RSEncryptProofRoute',
OLSKRouteFunction (req, res, next) {
return res.OLSKExpressLayoutRender(require('path').join(__dirname, 'stub-view'));
},
OLSKRouteLanguageCodes: ['en'],
}, {
OLSKRoutePath: '/sw.js',
OLSKRouteMethod: 'get',
OLSKRouteSignature: 'ZeroDataProofServiceWorkerRoute',
OLSKRouteFunction(req, res, next) {
return res.type('js').send(OLSKServiceWorker.OLSKServiceWorkerView({
VERSION_ID_TOKEN: kProofServiceWorkerVersionID,
ORIGIN_PAGE_PATH_TOKEN: res.locals.OLSKCanonical('RSEncryptProofRoute'),
}));
},
}];
};
exports.OLSKControllerSharedStaticAssetFolders = function () {
return [
'node_modules',
];
};