简体   繁体   English

使用 nodejs 进行虚拟重载

[英]Virtual reload using nodejs

I want to reload(refresh) my website every 25min to keep it live in Heroku.我想每 25 分钟重新加载(刷新)我的网站,以使其保持在 Heroku 中。

any code in nodejs to virtual reload or refresh nodejs 中用于虚拟重新加载或刷新的任何代码

I have used http request but not working我使用了 http 请求但不工作

please help me in this scenario.请在这种情况下帮助我。

you should reload page in your client side, by adding these line to your js file:您应该通过将这些行添加到您的 js 文件中来在客户端重新加载页面:

window.onload = function() {
  init();
  doSomethingElse();
  setTimeout(() => location.reload(), 25*60*1000)
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM