Basic framework added for league pages to be templated
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 25 KiB |
18
ProjectSourceCode/src/resources/js/homepage/routes.js
Normal file
18
ProjectSourceCode/src/resources/js/homepage/routes.js
Normal 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');
|
||||
});
|
||||
Reference in New Issue
Block a user