反映浏览器中的html更改,而无需重新启动快速应用程序 [英] Reflect html changes in browser without restarting the express app

查看:122
本文介绍了反映浏览器中的html更改,而无需重新启动快速应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个快速的应用程序我使用swig作为模板引擎。
当我点击刷新,可以在浏览器中反映我的HTML更改。我不想在每次需要进行HTML更改时重新启动服务器?

解决方案

我从中获得了解决方案链接



我将主管模块安装为全局安装

  npm install supervisor -g 

我表示我的应用程序这样

  supervisor -e html,js app.js 

这里我指定看看文件中的更改扩展名.html和.js。
所以当这些文件被更改时,它会在下一个请求到达时自动重新加载。不需要重启。


I have an express app. I am using swig as the template engine. Is it possible to reflect my HTML changes in the browser when I click refresh. I don't want to restart the server every time I need to do a HTML change?

解决方案

I got the solution from this link.

I installed supervisor module as global installation

npm install supervisor -g

I stated my app like this

supervisor -e html,js  app.js

Here i am specifying to watch the changes in files with extensions .html and .js. So when these files are changed its automatically reloaded when the next request comes.No restart required.

这篇关于反映浏览器中的html更改,而无需重新启动快速应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆