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.

53 lines
1.2 KiB

  1. const routes = require('express').Router();
  2. const utils = require("../../utils");
  3. const addUser = require('./addUser');
  4. routes.use('/addUser', addUser);
  5. const editUser = require('./edituser');
  6. routes.use('/edituser', editUser);
  7. const login = require('./login');
  8. routes.use('/login', login);
  9. const logout = require('./logout');
  10. routes.use('/logout', logout);
  11. const removeuser = require('./removeuser');
  12. routes.use('/removeuser', removeuser);
  13. const revokeAPI = require('./revokeAPI');
  14. routes.use('/revokeAPI', revokeAPI);
  15. const updateUser = require('./updateUser');
  16. routes.use('/updateUser', updateUser);
  17. const configLoader = require("../../configManager");
  18. function getUserInformation(templateContext, request)
  19. {
  20. templateContext.users = configLoader.getConfiguration().users;
  21. templateContext.apiKey = request.session.API;
  22. templateContext.id = request.session.userID;
  23. templateContext.username = request.session.username;
  24. }
  25. routes.get('/', (request, result) =>
  26. {
  27. if(utils.checkPrivilege(request) >= utils.PRIVILEGE.MEMBER)
  28. {
  29. utils.renderHTML(request, result, "users.html", getUserInformation);
  30. }
  31. else
  32. {
  33. utils.printError(result, "You need to be logged in");
  34. }
  35. });
  36. module.exports = routes;