Merge branch 'main' of github.com:LucasPatenaude/ScoreSpot

This commit is contained in:
Vishal Vunnam
2024-04-10 21:58:23 -06:00
40 changed files with 979 additions and 759 deletions

View File

@@ -12,6 +12,7 @@ const bodyParser = require('body-parser');
const session = require('express-session'); // To set the session object. To store or access session data, use the `req.session`, which is (generally) serialized as JSON by the store.
const bcrypt = require('bcryptjs'); // To hash passwords
const axios = require('axios'); // To make HTTP requests from our server. We'll learn more about it in Part C.
const moment = require('moment'); // To extract current time data
// *****************************************************
// <!-- Section 2 : Connect to DB -->
@@ -80,13 +81,33 @@ app.use(express.static(path.join(__dirname, 'resources')));
// <!-- Section 4 : API Routes -->
// *****************************************************
/************************
Header Scoreboard Routes
*************************/
const fetchMatchesData = require('./resources/js/navigation-bar/scoreboard-header/current-match-routes');
app.use(fetchMatchesData);
const convert_time = require('./resources/js/navigation-bar/scoreboard-header/convert-time');
app.use(convert_time);
/************************
Homepage Routes
*************************/
/* const { app, redirectToLeaguePage } = require('ProjectSourceCode/src/resources/js/homepage/create-league-routes.js');
// Serve static files
app.use(express.static('public')); */
/************************
Login Page Routes
*************************/
// Redirect to the /login endpoint
app.get('/', (req, res) => {
res.redirect('/login');
res.redirect('/home');
});
// Render login page for /login route
@@ -162,15 +183,13 @@ app.get('/', (req, res) => {
});
/************************
Discover Page Routes
Home Page Routes
*************************/
// Render registration page for /register route
app.get('/home', (req, res) => {
res.render('pages/home');
});
// *****************************************************
// <!-- Section 5 : Start Server-->
// *****************************************************