Jump to content

[Solved] Error when running nodejs application


closer1

Recommended Posts

The first time your node application is accessed it will take a little longer to load, but it will cache the website and subsequent visits will load much faster. After some time has passed without any page views your node application will automatically uncache itself to reduce load and memory usage on the server. If you make changes to your application, and find that the changes aren't appearing when you view the page in your browser it is because an older version of your site is cached. You can force your node application to restart and load any changes by doing the following:

Create a /tmp directory inside your node application directory.

/home/username/node/tmp

Inside that /tmp directory create a file named restart.txt.
Now refresh your browser and the changes should show up.

Here’s another note from this site that I just found earlier when I did some dig on Google:

https://airbrake.io/blog/http-errors/304-not-modified

@Heliohost Teams: delete this if I get it wrong, I’m learning new things. :D

Edited by Luigi123
Link to comment
Share on other sites

The first time your node application is accessed it will take a little longer to load, but it will cache the website and subsequent visits will load much faster. After some time has passed without any page views your node application will automatically uncache itself to reduce load and memory usage on the server. If you make changes to your application, and find that the changes aren't appearing when you view the page in your browser it is because an older version of your site is cached. You can force your node application to restart and load any changes by doing the following:

 

Create a /tmp directory inside your node application directory.

 

/home/username/node/tmp

 

Inside that /tmp directory create a file named restart.txt.

Now refresh your browser and the changes should show up.

 

Here’s another note from this site that I just found earlier when I did some dig on Google:

 

https://airbrake.io/blog/http-errors/304-not-modified

 

@Heliohost Teams: delete this if I get it wrong, I’m learning new things. :D

The page that returns status_code 304 is the correct page for me

Link to comment
Share on other sites

 

 

Great! :) Let us know if you still need any help.

Sorry but I want help in the case of status code 502 (2nd image).

The page that returns status_code 502 is the incorrect page for me

Ummmm I'm not sure about that. I'll escalated this to our root admin to see if he has any ideas.

 

Escalating

Link to comment
Share on other sites

Mentioning that you're connecting to a remote mongodb database would have saved me like 45 mins. All outbound ports are closed unless you request access. The reason any pages with database connections are timing out is because you never requested permission to access a remote database so the firewall is blocking you. I'm honestly a little annoyed with you right now for wasting my time.

Link to comment
Share on other sites

Mentioning that you're connecting to a remote mongodb database would have saved me like 45 mins. All outbound ports are closed unless you request access. The reason any pages with database connections are timing out is because you never requested permission to access a remote database so the firewall is blocking you. I'm honestly a little annoyed with you right now for wasting my time.

I apologize for not stating the problem. Can you help me open the firewall in this case?

Thank you very much

Link to comment
Share on other sites

Mentioning that you're connecting to a remote mongodb database would have saved me like 45 mins. All outbound ports are closed unless you request access. The reason any pages with database connections are timing out is because you never requested permission to access a remote database so the firewall is blocking you. I'm honestly a little annoyed with you right now for wasting my time.

I tried uploading the page to heroku. Everything on it works as I expected.

I think I have granted remote database access to my mongodb database.

Please help me . Thank you

Link to comment
Share on other sites

What IP and what port?

I really don't understand what you mean.

I am using mongodb provided by Atlas - MongoDB.
The connection string is "mongodb+srv://dev_user:<password>@cluster0-6habu.azure.mongodb.net/db_webhdh_quangnam?retryWrites=true&w=majority" with the connection type is "DNS Seedlist"
Link to comment
Share on other sites

The ip is the ip that your script tries to connect to. For instance if the database was hosted on Tommy the ip would be 65.19.143.6.

 

The port is the port that your script tries to connect to. For instance if you were using mysql on the default port it would be 3306.

Link to comment
Share on other sites

The ip is the ip that your script tries to connect to. For instance if the database was hosted on Tommy the ip would be 65.19.143.6.

 

The port is the port that your script tries to connect to. For instance if you were using mysql on the default port it would be 3306.

IP: 104.40.21.132

Domain Name: cluster0-shard-00-00-6habu.azure.mongodb.net

Port: 27017

Thanks you!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...