mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 14:22:07 +03:00
006c83fbe4
refs #9589
24 lines
744 B
JavaScript
24 lines
744 B
JavaScript
const debug = require('ghost-ignition').debug('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);
|
|
};
|