mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
b6b299a8f7
no issue - Upgraded ghost-ignition - Use debug from ghost-ignition everywhere in the code base - Remove debug dependency - Fixed random typo in Gruntfile.js
16 lines
540 B
JavaScript
16 lines
540 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) {
|
|
/*jslint unparam:true*/
|
|
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);
|
|
};
|