node.js - iisnode 不会在文件更改时重新启动/更新 Node.js
问题描述
使用 iisnode 并且每当我更改.js
或更改.hbs (handlebars)
文件时,Node.js 应用程序都不会重新启动以更新更改。但是,如果我更改我的web.config
文件,那么它确实会更新。
这基本上就是我web.config
文件中的内容。我还将 iisnode.yml 文件更新为相同(但我不明白为什么我不能让 web.config 文件做所有事情......为什么有 iisnode.yml?)
<configuration>
<system.webServer>
....
<!-- rewrite rules and handler appears here --->
<iisnode
node_env="%node_env%"
nodeProcessCountPerApplication="1"
maxConcurrentRequestsPerProcess="1024"
maxNamedPipeConnectionRetry="100"
namedPipeConnectionRetryDelay="250"
maxNamedPipeConnectionPoolSize="512"
maxNamedPipePooledConnectionAge="30000"
asyncCompletionThreadCount="0"
initialRequestBufferSize="4096"
maxRequestBufferSize="65536"
watchedFiles="*;*.hbs;web.config;*.js" <!-- told it to watch everything -->
uncFileChangesPollingInterval="5" <!--- very low polling interval -->
gracefulShutdownTimeout="60000"
loggingEnabled="true"
logDirectory="iisnode"
debuggingEnabled="true"
debugHeaderEnabled="false"
debuggerPortRange="5058-6058"
debuggerPathSegment="debug"
maxLogFileSizeInKB="128"
maxTotalLogFileSizeInKB="1024"
maxLogFiles="20"
devErrorsEnabled="true"
flushResponse="false"
enableXFF="false"
promoteServerVars=""
configOverrides="iisnode.yml"
/>
</system.webServer>
</configuration>
为什么iisnode在我更新时只刷新node.js服务器而不刷新web.config
任何其他文件?
解决方案
根据白兰度的评论,我通过这样做修复了它:
watchedFiles="*.js;*.hbs;web.config;routes\*;views\*;controllers\*;models\*"
该行指定除根文件夹之外的哪些文件夹,您希望 iisnode 监视文件的更改。
推荐阅读
- java - 如何以最佳方式在休眠中为以下条件创建条件查询
- javascript - Web Audio API 上的离线源
- docker - docker daemon 意外退出
- python - 有人可以通过在此处指出并更正错误来帮助我吗,因为我想每 24 小时重复一次该消息?
- vue.js - 如何在我自己的组件 vuejs 中使用模板
- javascript - 在 wordpress 网站上选择输入字段时,Android 键盘打开然后立即关闭
- javascript - Puppeteer 无法在 heroku 上找到选择器,但在本地工作
- dynamics-crm - 具有空 ChangedData 行的 Dynamics CRM
- python - 我正在测试一些模块及其功能,但是当我运行它时,它说:
- python - 将多行附加到空数据框中的特定列