Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
610 B

  1. const postGenerator = require('../utils/renderBlogPost.js');
  2. module.exports=
  3. {
  4. /**
  5. * Renders a preview of the post with a link to view more
  6. *
  7. * @param res
  8. * @param post
  9. */
  10. renderPreview: function(post)
  11. {
  12. return postGenerator.generateBlogPost(post, 3);
  13. },
  14. /**
  15. * renderPost() displays a single blog post in it's entirety
  16. *
  17. * @param res result sent to user
  18. * @param post sql data about the blog post
  19. * @return {*|Promise}
  20. */
  21. renderPost: function(post)
  22. {
  23. return postGenerator.generateBlogPost(post, -1);
  24. }
  25. };