Hello, i am trying to deploy simple node js + express app.
server.js
const express = require('express');
const app = express();
const port = 3000; // Change this to the desired port number
// Set up a route for version information
app.get('/version', (req, res) => {
const nodeVersion = process.version; // Node.js version
const expressVersion = require('express/package.json').version; // Express version
const versionInfo = {
node: nodeVersion,
express: expressVersion
};
res.json(versionInfo);
});
// Start the server
app.listen(port, () => {
console.log(`Server listening on port ${port}`);
});
package.json
{
"name": "webhook",
"version": "1.0.0",
"description": "Your application description",
"main": "server.js",
"scripts": {
"start": "node server.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/xxx/xxx.git"
},
"keywords": [],
"author": "Your Name",
"license": "MIT",
"bugs": {
"url": "https://github.com/xxx/xxxs"
},
"homepage": "https://github.com/xxx/xxxe",
"dependencies": {
"express": "^4.18.2"
},
"devDependencies": {}
}
I am getting this error
Deploy Error: Health Checks Component Issues failed to deploy
Attaching the screenshot of deploy log and error error log
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
I try to set the port to 3000 I am getting this error
i tried to change the port to 3001 in my code.
I still get same error Deploy Error: Health Checks
This comment has been deleted
Hi there,
It looks like that your app is listening on port 3000. This should also be the health check port, can you confirm if this is the case?
What you could do is:
After that save the settings and give it another try.
Let me know how it goes!
Best,
Bobby