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.

34 lines
812 B

  1. const routes = require('express').Router();
  2. const analytics = require('./analytics');
  3. routes.use('/analytics', analytics);
  4. const login = require('./login');
  5. routes.use('/login', login);
  6. const posts = require('./posts');
  7. routes.use('/posts', posts);
  8. const downloads = require('./downloads');
  9. routes.use('/downloads', downloads);
  10. const users = require('./users');
  11. routes.use('/users', users);
  12. const utils = require('../../utils/utils.js');
  13. routes.get('/', (request, result) =>
  14. {
  15. utils.constructAdminPage(request, result, require("../../admin/adminHome").main)
  16. });
  17. routes.post('/', (request, result) =>
  18. {
  19. utils.constructAdminPage(request, result, require("../../admin/adminHome").processPostData);
  20. });
  21. routes.get('*', (request, result) =>
  22. {
  23. utils.print404(result);
  24. });
  25. module.exports = routes;