refactor: serve static files from a dedicated directory
This commit is contained in:
parent
be6d378890
commit
299b8c1404
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "calendar-merger",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "calendar-merger",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"axios": "^1.7.7",
|
||||
|
|
|
@ -13,9 +13,8 @@ console.log(`Merged calendars directory: ${MERGED_CALENDARS_DIR} under ${process
|
|||
// Ensure the merged calendars directory exists
|
||||
fs.mkdirSync(MERGED_CALENDARS_DIR, { recursive: true });
|
||||
|
||||
// Serve static files
|
||||
app.get('/script.js', (req, res) => res.sendFile('script.js', { root: '.' }));
|
||||
app.get('/', (req, res) => res.sendFile('index.html', { root: '.' }));
|
||||
// Serve static files from the 'public' directory
|
||||
app.use(express.static(path.join(process.cwd(), 'public')));
|
||||
|
||||
// Utility to sanitize filenames
|
||||
const sanitizeFilename = (filename) => filename.replace(/[<>:"/\\|?* ]/g, '_');
|
||||
|
|
Loading…
Reference in New Issue