Basic framework added for league pages to be templated

This commit is contained in:
Lucas Patenaude
2024-04-09 17:31:04 -06:00
parent 6abdd66b2b
commit 239d354c2e
7 changed files with 30 additions and 35 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,18 @@
const express = require('express');
const app = express();
const exphbs = require('express-handlebars');
app.engine('hbs', exphbs({ extname: '.hbs' }));
app.set('view engine', 'hbs');
// Define a route to render the league-page.hbs template
app.get('/league-page/:leagueName', (req, res) => {
const leagueName = req.params.leagueName;
// Here you might fetch data related to the clicked league
// Pass the data to the template and render it
res.render('league-page', { leagueName });
});
app.listen(3000, () => {
console.log('Server is running on http://localhost:3000');
});