Website for visualizing a persons github network.
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.

33 lines
829 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. app.use(express.urlencoded()); //for easy retrieval of post and get data
  13. app.use(express.json());
  14. app.use(express.static('css'));
  15. app.use(express.static('js'));
  16. app.use(express.static('img'));
  17. app.use(express.static('html'));
  18. const routes = require('./routes');
  19. app.use('/', routes);
  20. app.listen(configLoader.getConfiguration().port, () =>
  21. console.log(`App listening on port ${configLoader.getConfiguration().port}!`)
  22. );