Ghost/core/server/web/admin/serviceworker.js
Katharina Irrgang 7bcccc71dc
Moved apps into web folder (#9308)
refs #9178

- move express apps to one place (called `web`)
- requires https://github.com/TryGhost/Ghost-Admin/pull/923
- any further improvements are not part of this PR
- this PR just moves the files and ensures the paths are up-to-date
2017-12-06 17:37:54 +01:00

16 lines
523 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);
};