434a0435fd
no issue - optimised only for web/ folder, because it has used very general namespaces - the debug namespace must be specific, otherwise i run `DEBUG=ghost:api:*` and i get web debug logs and api folder debug logs - we can come up with a new namespace system, but for now it must be explicit enough
24 lines
748 B
JavaScript
24 lines
748 B
JavaScript
const debug = require('ghost-ignition').debug('web:admin:controller');
|
|
const path = require('path');
|
|
const config = require('../../config');
|
|
const updateCheck = require('../../update-check');
|
|
const common = require('../../lib/common');
|
|
|
|
// Route: index
|
|
// Path: /ghost/
|
|
// Method: GET
|
|
module.exports = function adminController(req, res) {
|
|
debug('index called');
|
|
|
|
// run in background, don't block the admin rendering
|
|
updateCheck()
|
|
.catch((err) => {
|
|
common.logging.error(err);
|
|
});
|
|
|
|
const defaultTemplate = config.get('env') === 'production' ? 'default-prod.html' : 'default.html';
|
|
const templatePath = path.resolve(config.get('paths').adminViews, defaultTemplate);
|
|
|
|
res.sendFile(templatePath);
|
|
};
|