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.
 
 

38 lines
864 B

const routes = require('express').Router();
const analytics = require('./analytics');
routes.use('/analytics', analytics);
const login = require('./login');
routes.use('/login', login);
const posts = require('./posts');
routes.use('/posts', posts);
const downloads = require('./downloads');
routes.use('/downloads', downloads);
const users = require('./users');
routes.use('/users', users);
const utils = require('../../utils/utils.js');
routes.get('/', (request, result) =>
{
utils.constructAdminPage(request, result, require("../../admin/adminHome").main)
});
routes.post('/', (request, result) =>
{
utils.adminPostRoute(request, require("../../admin/adminHome").processPostData).then(function()
{
result.redirect("/admin");
});
});
routes.get('*', (request, result) =>
{
utils.print404(result);
});
module.exports = routes;