502 gateway error when deploying expressjs app

I have followed this guide. My app.listen is listening to port from env, I have correctly listed app.js as entry point.
Here is my code:

Its very basic express app with just one route. I cannot figure out whats the issue.
No error in logs
Any help would be appriciated!

Hello @hassancent,

It appears the issue is related to ports. We suggest utilizing the dotenv module to manage environment variables, particularly for reading the port number from the .env file. The module can be found here: GitHub - motdotla/dotenv: Loads environment variables from .env for nodejs projects.

After setting up dotenv, navigate to Deployments > Workflow > Environment to handle your environment variables. This should assist in resolving the port-related matter. If you encounter any challenges or have questions, feel free to reach out.

Thanks! Its fixed now