mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
7bcccc71dc
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
16 lines
523 B
JavaScript
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);
|
|
};
|