Jump to content

Recommended Posts

Posted

I have configured my nodejs application, but I get an error when I request the page to use data from a database.

Please help me. Thank you very much

 

 

image80adf88add63354b.png
 
 
imagea147c473dcb4cc18.png
Posted (edited)

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
Posted

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

Posted

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

Posted

 

 

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

Posted

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.

Posted

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

Posted

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

Posted

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"
Posted

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.

Posted

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!

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