首页 \ 问答 \ PM2在浏览器中没有显示快速应用程序(PM2 not showing Express app in browser)

PM2在浏览器中没有显示快速应用程序(PM2 not showing Express app in browser)

我在Express应用程序中使用PM2进行进程管理和负载平衡。 我刚刚安装了PM2并给出命令pm2 start bin/www这个命令在命令提示符下工作,它显示的结果是这样的:

3]

这很好,现在我打开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:

3]

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
更新时间:2022-12-02 07:12

最满意答案

由于没有办法实现这个开箱即用,我最终实现了自己的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.
  • 我也在为你的问题寻求答案。 在那之前,我会试着弄明白自己,如果我找到有用的东西,我会回复。 更新:在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设置器,因为那里也没有进行正确的欺骗检查。 第一次编辑该值并发生无限循环。 这些示例在发生时很明显,但随着通知层 ...
  • 您应该可以将任何属性添加到标记中,如下所示: 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 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)