PM2在浏览器中没有显示快速应用程序(PM2 not showing Express app in browser)
我在Express应用程序中使用PM2进行进程管理和负载平衡。 我刚刚安装了PM2并给出命令
pm2 start bin/www
这个命令在命令提示符下工作,它显示的结果是这样的:这很好,现在我打开web浏览器并像往常一样访问
localhost:3000
但它并未打开应用程序,它在浏览器中显示为ok 。可能的原因是什么? 请帮忙。 谢谢。
I am using PM2 in my Express app for process management and load balancing. I have just installed the PM2 and given the command
pm2 start bin/www
this command works in command prompt, it is showing the result like this:This is fine now I am opening the web browser and accessing the application as usual
localhost:3000
but it is not opening the application its is showing ok in the browser.What could be the possible reason? Please help. Thanks.
原文:https://stackoverflow.com/questions/42153764
最满意答案
由于没有办法实现这个开箱即用,我最终实现了自己的Filter,这对于这个用例来说非常简单:
public class NoMarkerFilter extends MatchingFilter { @Override public FilterReply decide(final Marker marker, final Logger logger, final Level level, final String format, final Object[] params, final Throwable t) { if (!isStarted()) { return FilterReply.NEUTRAL; } if (marker == null) { return onMatch; } return onMismatch; }
然后可以在以下配置中使用它:
<turboFilter class="com.example.NoMarkerFilter"> <OnMatch>DENY</OnMatch> </turboFilter>
Since there is no way to achieve this out of the box, I ended up implementing my own Filter, which is simple enough for this use case:
public class NoMarkerFilter extends MatchingFilter { @Override public FilterReply decide(final Marker marker, final Logger logger, final Level level, final String format, final Object[] params, final Throwable t) { if (!isStarted()) { return FilterReply.NEUTRAL; } if (marker == null) { return onMatch; } return onMismatch; }
It can then be used in the configuration like this:
<turboFilter class="com.example.NoMarkerFilter"> <OnMatch>DENY</OnMatch> </turboFilter>
相关问答
更多-
将“我的位置”标记的可点击属性设置为false clickable | boolean | If true, the marker receives mouse and touch events. Default value is true. Set the clickable property of the "My Position" marker to false clickable | boolean | If true, the marker receives mouse and touch ev ...
-
尝试这个: marker.events.register('mousedown', marker, function(evt){ this.pop.show(); OpenLayers.Event.stop(evt); }); Try this: marker.events.register('mousedown', marker, function(evt){ this.pop.show(); OpenLayers.Event.stop(evt); });
-
我认为这是人们拥有的Javascript中的普遍“封闭”问题。 有人可能会提供更好的方法,但我认为你需要这样的东西: google.maps.event.addListener(playerMarker, "click", (function() { return function () { var elementConnected = citymap[city].elementId; console.log(elementConnected); }; })( ...
-
由于没有办法实现这个开箱即用,我最终实现了自己的Filter,这对于这个用例来说非常简单: public class NoMarkerFilter extends MatchingFilter { @Override public FilterReply decide(final Marker marker, final Logger logger, final Level level, final String format, final Object[] params, final T ...
-
选项和事件之间缺少逗号。 Thanx to Dr.Molle。 There was a comma missing between options and event. Thanx to Dr.Molle.
-
从DirectionsRenderer中获取折线或标记的事件(Get events from polyline or marker from a DirectionsRenderer)[2022-04-18]
我也在为你的问题寻求答案。 在那之前,我会试着弄明白自己,如果我找到有用的东西,我会回复。 更新:在JavaScript中几分钟之后,我发现DirectionsResult对象包含一个路点数组,包括用光标拖动路径时创建的路点。 如果您完成了Draggable Directions教程 ,则可以通过directionsDisplay.directions访问该对象,该方法位于directions_changed事件的回调方法中。 该对象包含一个名为sf的成员,如果存在,则包含一个waypoints数组,如果没 ... -
您看到的日志格式不是logback 2013-03-02 11:19:26.665:DBUG:oeju.Scanner:scanned .... 这是Jetty自己的内部StdErrLog生成的日志格式。 因此,使用logback过滤掉它将无法正常工作。 如何在Jetty中进行回归工作 首先,确保您的服务器类路径中存在slf4j-api和logback jar。 最简单的方法是将它们放在${jetty.home}/lib/ext/中,并通过快速检查命令行来验证它们是否存在。 $ java -jar sta ...
-
根据http://groups.google.com/group/google-visualization-api/browse_thread/thread/2bcb89a1eb3c647d ,目前不支持此功能。 According to http://groups.google.com/group/google-visualization-api/browse_thread/thread/2bcb89a1eb3c647d it's not currently supported.
-
并非总是如此,但通常这可能表明事件级联链的某些元素未正确检测到它们不需要发送事件。 经典插图是一个bean设置器,即使值未更改,也会生成PropertyChangeEvent。 虽然你所做的将过滤掉这些事件,但它并没有解决可能是一个基本的潜在问题。 问题是这些“错误”可以组合形成无限循环。 扩展上面的bean示例,假设您有一个UI根据该bean字段重置其可编辑值...并且重置UI值也将调用bean设置器,因为那里也没有进行正确的欺骗检查。 第一次编辑该值并发生无限循环。 这些示例在发生时很明显,但随着通知层 ...
-
Openlayers标记(Openlayers marker)[2022-10-21]
您应该可以将任何属性添加到标记中,如下所示: marker.URL = "http://www.google.com/"; 然后您的事件处理程序可以像这样编写一次: function linkHandler(e) { location.href = this.URL; } marker.events.register("click", marker, linkHandler); 请注意,marker.events.register调用中的“map”参数已更改为“marker”。 You sho ...