mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
bcf5a1bc34
refs #9178 * Add eslint deps, remove old lint deps * Add eslint config, remove old lint configs * Config for server and tests are different * Tweaked rules to suit us * Fix linting in codebase - lots of indent changes. * Fix a real broken test
16 lines
512 B
JavaScript
16 lines
512 B
JavaScript
var debug = require('ghost-ignition').debug('admin:serviceworker'),
|
|
path = require('path');
|
|
|
|
// Route: index
|
|
// Path: /ghost/sw.js|sw-registration.js
|
|
// Method: GET
|
|
module.exports = function adminController(req, res) {
|
|
debug('serviceworker called');
|
|
|
|
var sw = path.join(__dirname, '..', '..', 'built', 'assets', 'sw.js'),
|
|
swr = path.join(__dirname, '..', '..', 'built', 'assets', 'sw-registration.js'),
|
|
fileToSend = req.url === '/sw.js' ? sw : swr;
|
|
|
|
res.sendFile(fileToSend);
|
|
};
|