forked from ryanmwangi/CalMerger
refactor: add starter script
This commit is contained in:
parent
5b3a47a122
commit
495557e6c2
3 changed files with 11 additions and 14 deletions
6
app.js
Normal file
6
app.js
Normal 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}`);
|
||||
});
|
10
package.json
10
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": {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue