Node.js有时不响应HTTP GET

时间:2021-03-24 16:57:11

I have a web page with the following line:

我有一个包含以下行的网页:

<link rel="stylesheet" type="text/css" href="stylesheets/toolbar.css"/>

From time to time I see a problem that I can't properly reproduce. One of the resources sometimes never loads. Sometimes it is a JavaScript file, sometimes a CSS file like on the screenshot below. I have this default application setup:

我不时会看到一个无法正确复制的问题。其中一种资源有时从不加载。有时它是一个JavaScript文件,有时候是一个CSS文件,如下面的截图所示。我有这个默认的应用程序设置:

app.use(logger('dev'));
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({extended: false}));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

app.use('/', routes);

Node.js有时不响应HTTP GET

The logs look as if the CSS file has been loaded:

日志看起来好像已经加载了CSS文件:

GET /javascripts/viewport.js - - ms - 11021
GET /stylesheets/toolbar.css - - ms - -
GET /javascripts/run.js 200 13.679 ms - 6035

A page reload "solves" the problem, but I want it to be stable!

页面重新加载“解决”问题,但我希望它稳定!

I use this command to run Node.js:

我使用此命令来运行Node.js:

"C:\Program Files\nodejs\node.exe" -v v0.10.26

I observe this within Firebug's Net panel. How can I solve this problem?

我在Firebug的Net面板中观察到了这一点。我怎么解决这个问题?

1 个解决方案

#1


Upgrade from express 4.9.8 -> 4.12.3 seems to resolve the issue, at least i haven't observed the problem ever. No other changes were made.

从快递4.9.8升级 - > 4.12.3似乎解决了这个问题,至少我没有观察过这个问题。没有进行任何其他更改。

#1


Upgrade from express 4.9.8 -> 4.12.3 seems to resolve the issue, at least i haven't observed the problem ever. No other changes were made.

从快递4.9.8升级 - > 4.12.3似乎解决了这个问题,至少我没有观察过这个问题。没有进行任何其他更改。