closer1 Posted April 26, 2020 Posted April 26, 2020 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
Luigi123 Posted April 26, 2020 Posted April 26, 2020 (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/tmpInside 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. Edited April 26, 2020 by Luigi123
closer1 Posted April 26, 2020 Author Posted April 26, 2020 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. The page that returns status_code 304 is the correct page for me
closer1 Posted April 26, 2020 Author Posted April 26, 2020 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
Luigi123 Posted April 26, 2020 Posted April 26, 2020 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 meUmmmm I'm not sure about that. I'll escalated this to our root admin to see if he has any ideas. Escalating
closer1 Posted April 27, 2020 Author Posted April 27, 2020 What is the url of your nodejs page? I visit the page https://vnu.hdhquangnam.tk/ also has the same results as the page https://vnu.hdhquangnam.tk/test. But when I accessed https://vnu.hdhquangnam.tk/about, the result was running as I expected
Krydos Posted April 28, 2020 Posted April 28, 2020 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.
closer1 Posted April 28, 2020 Author Posted April 28, 2020 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
closer1 Posted May 1, 2020 Author Posted May 1, 2020 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
closer1 Posted May 2, 2020 Author Posted May 2, 2020 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"
Krydos Posted May 2, 2020 Posted May 2, 2020 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.
closer1 Posted May 3, 2020 Author Posted May 3, 2020 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.132Domain Name: cluster0-shard-00-00-6habu.azure.mongodb.netPort: 27017Thanks you!
Recommended Posts