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.

45 lines
1.1 KiB

  1. const routes = require('express').Router();
  2. /** about page */
  3. const about = require('./about');
  4. routes.use('/about', about);
  5. /** admin page and all of its sub pages */
  6. const admin = require('./admin');
  7. routes.use('/admin', admin);
  8. /** Contact page */
  9. const contact = require('./contact');
  10. routes.use('/contact', contact);
  11. /** Downloads path for files */
  12. const downloads = require('./downloads');
  13. routes.use('/downloads', downloads);
  14. /** static content like css, js, and images */
  15. const includes = require('./includes');
  16. routes.use('/includes', includes);
  17. /** category pages */
  18. const category = require('./category');
  19. routes.use('/category', category);
  20. const pageBuilder = require('../utils/pageBuilder');
  21. const projects = ["/steam/"];
  22. //blog home page
  23. routes.get('/', (request, result) =>
  24. {
  25. pageBuilder.buildBlogPage(request, result, require("../blog/homePage").main)
  26. });
  27. //regular blog posts
  28. routes.get('*', (request, result) =>
  29. {
  30. pageBuilder.buildBlogPage(request, result,
  31. require("../blog/posts").main, request.url);
  32. });
  33. module.exports = routes;