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.

35 lines
907 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(__dirname,'css'));
  15. app.use(express.static(__dirname, 'js'));
  16. app.use(express.static(__dirname, 'img'));
  17. app.use(express.static('html'));
  18. app.use(express.static(__dirname, 'fonts'));
  19. const routes = require('./routes');
  20. app.use('/', routes);
  21. app.listen(configLoader.getConfiguration().port, () =>
  22. console.log(`App listening on port ${configLoader.getConfiguration().port}!`)
  23. );