Lightweight node app to use in place of plex to self host your video and movie collections. Running on just under 50MB of ram this is ideal for people looking to host videos on minimal hardware.
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.
 
 
 
 

42 lines
1.2 KiB

const routes = require('express').Router();
const utils = require("../../utils");
const indexVideos = require('./indexVideos');
routes.use('/indexVideos', indexVideos);
const updateSystem = require('./updateSystem');
routes.use('/updateSystem', updateSystem);
const configLoader = require("../../configManager");
const videoManager = require("../../videoManager");
function getSystemInformation(templateContext, request)
{
templateContext.serverURL = process.env.SERVER_URL;
templateContext.privateDir = process.env.PRIVATE_DIR;
templateContext.publicDir = process.env.PUBLIC_DIR;
templateContext.publicVideoCount = videoManager.getPublicVideoCount();
templateContext.privateVideoCount = videoManager.getPrivateVideoCount();
templateContext.userCount = configLoader.getUserCount();
}
routes.get('/', (request, result) =>
{
if(utils.checkPrivilege(request) >= utils.PRIVILEGE.ADMIN)
{
utils.renderHTML(request, result, "system.html", getSystemInformation);
}
else
{
utils.printError(result, "You need to be logged in");
}
});
routes.get('*', (request, result) =>
{
utils.printError(result, "Page not found.");
});
module.exports = routes;