1
This commit is contained in:
@@ -131,7 +131,10 @@ app.delete('/api/leads/:id', (req, res) => {
|
||||
|
||||
// Serve frontend
|
||||
app.get('/', (req, res) => {
|
||||
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
||||
const years = new Date().getFullYear() - 2011;
|
||||
const htmlPath = path.join(__dirname, 'public', 'index.html');
|
||||
const html = fs.readFileSync(htmlPath, 'utf8');
|
||||
res.send(html.replace(/\{years\}/g, String(years)));
|
||||
});
|
||||
|
||||
app.listen(PORT, async () => {
|
||||
|
||||
Reference in New Issue
Block a user