I created a Cron job (to be called every minute, just for testing) using node env. It was called only once, the first time it started and was never called again.
Please advice if I have implemented correctly ?
Here is my render.com settings .
command: npm start
build command: npm install
Schedule (every minute): * * * * *
Logs from render.com
Mar 3 03:32:06 PM Example app listening on port 3000
Mar 3 03:33:29 PM ==> Starting service with 'npm start'
Mar 3 03:33:29 PM
Mar 3 03:33:29 PM > myapp@1.0.0 start /opt/render/project/src
Mar 3 03:33:29 PM > node app.js
Mar 3 03:33:29 PM
Mar 3 03:33:30 PM Server running
Here is my package.json
{
"name": "myapp",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"start": "node app.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2",
"node-cron": "^3.0.2"
}
}