I deployed a simple express application which (by looking at the logs) has successfully been connected to the database and is listening on port 3000, but when I try to open it, it opens a page with the following content:
As someone on StackOverflow recommended, I tried changing HOSTNAME, the express app listens to, from initially not specified to ‘0.0.0.0’, but to no avail.
The listener is set in ‘./database.js’ file after the database connection has been established. According to the logs, the app runs just fine. The problem is that I can’t access it via the link provided in the ‘Actions’ menu.
I think I’ve found the cause of the problem
I have now tried to deploy the simplest possible application with the only dependency, express, and it worked. But when I add any other dependency in package.json (without even using one in the code) like mongoose, jsonwebtoken, or cors, the deployment fails again.
Maybe there’s something missing in my package.json file?
After removing package-lock.json file from the repo, both apps were successfully deployed. So, the problem has something to do with the package-lock.json.