index.js 902 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. 'use strict';
  2. const express = require('express');
  3. const router = express.Router();
  4. /**
  5. * Home Controller
  6. */
  7. const HomeController = require('../controllers/home');
  8. function init(app, passport) {
  9. /**
  10. * Set up routes
  11. */
  12. const contactRoutes = require('./contact')(router);
  13. const listRoutes = require('./list')(router);
  14. const pagesRoutes = require('./pages')(router);
  15. const profileRoutes = require('./profile')(router);
  16. const uploadRoutes = require('./upload')(router);
  17. const userRoutes = require('./user')(router, passport);
  18. const watchRoutes = require('./watch')(router);
  19. /**
  20. * Mount routes
  21. */
  22. /** GET / - Home */
  23. app.get('/', HomeController.index);
  24. app.use('/', contactRoutes);
  25. app.use('/', listRoutes);
  26. app.use('/', pagesRoutes);
  27. app.use('/', profileRoutes);
  28. app.use('/', uploadRoutes);
  29. app.use('/', userRoutes);
  30. app.use('/', watchRoutes);
  31. }
  32. module.exports = { init };