forked from ryanmwangi/CalMerger
use a fixed URL for the merged calendar
This commit is contained in:
parent
3d31d039d8
commit
37108217d8
|
@ -172,7 +172,7 @@ END:VEVENT
|
||||||
fs.writeFileSync(filename, icalString);
|
fs.writeFileSync(filename, icalString);
|
||||||
|
|
||||||
// Generate a unique URL for the merged calendar
|
// Generate a unique URL for the merged calendar
|
||||||
const mergedCalendarUrl = `${req.protocol}://${req.get('host')}/${filename}`;
|
const mergedCalendarUrl = `http://localhost:3000/${filename}`;
|
||||||
|
|
||||||
// Store the merged calendar URL in a file
|
// Store the merged calendar URL in a file
|
||||||
fs.writeFileSync(mergedCalendarUrlFile, mergedCalendarUrl);
|
fs.writeFileSync(mergedCalendarUrlFile, mergedCalendarUrl);
|
||||||
|
@ -197,7 +197,7 @@ app.get('/merged-calendar', (req, res) => {
|
||||||
const mergedCalendarUrl = fs.readFileSync(mergedCalendarUrlFile, 'utf8');
|
const mergedCalendarUrl = fs.readFileSync(mergedCalendarUrlFile, 'utf8');
|
||||||
res.redirect(mergedCalendarUrl);
|
res.redirect(mergedCalendarUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start the server
|
// Start the server
|
||||||
const port = 3000;
|
const port = 3000;
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
|
|
Loading…
Reference in New Issue