refactor: add starter script

This commit is contained in:
xeruf 2024-11-07 10:28:11 +01:00
parent 5b3a47a122
commit 495557e6c2
3 changed files with 11 additions and 14 deletions

6
app.js Normal file
View File

@ -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}`);
});

View File

@ -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": {

View File

@ -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;