mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
- Allow the frontend to accept post messages to generate previews of the frontend - Created a new endpoint in admin we can use to render these previews, which is possibly not necessary - Supports a limited group of settings, which can easily be expanded, but care should be taken if expanding to use user-provided strings
15 lines
344 B
JavaScript
15 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
|
|
];
|