mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
08479f3816
- The helpers folder was full of things used for rendering pages - It belongs as its own service so that we can see what it really does
19 lines
590 B
JavaScript
19 lines
590 B
JavaScript
const debug = require('@tryghost/debug')('services:routing:renderer:render-post');
|
|
const formatResponse = require('./format-response');
|
|
const renderer = require('./renderer');
|
|
/**
|
|
* @description Helper to handle rendering multiple resources.
|
|
*
|
|
* @param {Object} req
|
|
* @param {Object} res
|
|
* @returns {Closure)
|
|
*/
|
|
module.exports = function renderEntry(req, res) {
|
|
debug('renderEntry called');
|
|
return function renderEntryClosure(entry) {
|
|
// Format data 2 - 1 is in preview/entry
|
|
// Render
|
|
return renderer(req, res, formatResponse.entry(entry));
|
|
};
|
|
};
|