diff --git a/app.js b/app.js new file mode 100644 index 0000000..217a7e6 --- /dev/null +++ b/app.js @@ -0,0 +1,6 @@ +import server from './server.js'; + +const port = process.env.NODE_PORT || 3000; +server.listen(port, () => { + console.log(`Server started on port ${port}`); +}); diff --git a/package.json b/package.json index 585b394..def9d85 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,8 @@ { "name": "calendar-merger", - "version": "1.0.0", - "type": "module", + "version": "1.1.0", "scripts": { - "start": "node server.js", + "start": "node app.js", "test": "jest ./test" }, "dependencies": { @@ -16,8 +15,9 @@ "node-cron": "^2.0.3", "supertest": "^7.0.0" }, - "description": "cal merge", - "main": "script.js", + "description": "calmerger", + "main": "server.js", + "type": "module", "author": "Ryan", "license": "ISC", "devDependencies": { diff --git a/server.js b/server.js index c352a0d..db2a6c5 100644 --- a/server.js +++ b/server.js @@ -234,13 +234,4 @@ function saveCalendarData(calendarId, linkGroupName, calendars) { } } -// Start the server -if (process.env.NODE_ENV !== 'test') { - const port = 3000; - app.listen(port, () => { - console.log(`Server started on port ${port}`); - }); -} - - export default app;