diff --git a/package-lock.json b/package-lock.json index d077334..8b89394 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/index.html b/public/index.html similarity index 100% rename from index.html rename to public/index.html diff --git a/script.js b/public/script.js similarity index 100% rename from script.js rename to public/script.js diff --git a/styles.css b/public/styles.css similarity index 100% rename from styles.css rename to public/styles.css diff --git a/server.js b/server.js index 1ee1831..3a6ea0c 100644 --- a/server.js +++ b/server.js @@ -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, '_');