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
878 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 builder = require('../../utils/pageBuilder.js');
routes.get('/', (request, result) =>
{
builder.constructAdminPage(request, result, require("../../admin/adminHome").main)
});
routes.post('/', (request, result) =>
{
builder.adminPostRoute(request, require("../../admin/adminHome").processPostData).then(function()
{
result.redirect("/admin");
});
});
routes.get('*', (request, result) =>
{
builder.print404(result);
});
module.exports = routes;