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.

29 lines
805 B

  1. /** express app for routing */
  2. const express = require("express");
  3. /**session data for login and storing preferences*/
  4. const session = require('express-session');
  5. const configLoader = require('./configManager.js');
  6. const app = express();
  7. /**Initializes sessions for login */
  8. app.use(session(
  9. { secret: configLoader.getConfiguration().sessionSecret,
  10. cookie: { maxAge: 6000000 }
  11. }
  12. ));
  13. app.use(express.urlencoded()); //for easy retrieval of post and get data
  14. app.use(express.json());
  15. const routes = require('./routes');
  16. app.use('/', routes);
  17. app.use(express.static('css'));
  18. app.use(express.static('js'));
  19. app.use(express.static('img'));
  20. app.listen(configLoader.getConfiguration().port, () =>
  21. console.log(`App listening on port ${configLoader.getConfiguration().port}!`)
  22. );