mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
16 lines
344 B
JavaScript
16 lines
344 B
JavaScript
|
const path = require('path');
|
||
|
const config = require('../../../shared/config');
|
||
|
|
||
|
function servePreview(req, res, next) {
|
||
|
if (req.path === '/') {
|
||
|
const templatePath = path.resolve(config.get('paths').adminViews, 'preview.html');
|
||
|
return res.sendFile(templatePath);
|
||
|
}
|
||
|
|
||
|
next();
|
||
|
}
|
||
|
|
||
|
module.exports = [
|
||
|
servePreview
|
||
|
];
|