我如何使用heroku工头调试node.js应用程序? [英] how do i debug a node.js app using heroku foreman?

查看:85
本文介绍了我如何使用heroku工头调试node.js应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是heroku和node.js的新手。我有一个小型的node.js应用程序,可以使用heroku工具栏中的FOREMAN在本地计算机上成功启动和运行。我不明白如何最好地调试应用程序。

i am new to heroku and node.js. i have a small node.js app which i can start and run successfully on my local machine using FOREMAN from the heroku toolbelt. i do not understand how to best debug the app, though.

我看到有一个针对Node.js和Node-Inspector项目的Eclipse调试器。但我似乎无法使这些与FOREMAN一起使用。

i see that there is an eclipse debugger for node.js as well as the node-inspector project. but i cant seem to make these work with FOREMAN.

foreman start

如果无法调试由领班启动的应用程序,领班的目的是什么?

if it is not possible to debug an app started by foreman, what is the purpose of foreman?

推荐答案

Foreman的目的是使您可以轻松运行复杂的应用程序,其中可能包含多个进程。查看作者关于工头的博客文章

The purpose of Foreman is to allow you to run complex applications, which may consist of several processes, easily. Check out the author's blog post on Foreman:


最近我注意到我的Web应用程序运行起来越来越复杂。我的
应用程序不再包含单个Web流程;我通常有
个或多个类型的后台工作者来运行不同类型的作业
和一个时钟进程来处理调度。以
的方式拆分应用程序对性能和可伸缩性非常有用。但是,
的缺点是,运行该应用程序及其所有
部件会变得更加复杂。

Lately I've noticed my web apps are getting complicated to run. My apps no longer consist of a single web process; I usually have have one or more types of background workers to run different types of jobs and a clock process to handle scheduling. Splitting an app up in this way is great for performance and scalability. The downside, however, is that it becomes much more complicated to get the app and all of its parts running.

领班是一种尝试使它更容易。使用领班,您可以
使用Procfile声明运行应用程序
所需的各种过程。

Foreman is an attempt to make this easier. Using foreman you can declare the various processes that are needed to run your application using a Procfile.

通过利用Foreman,Heroku做到了这一点,从而使您基本上可以运行想要的任何类型的过程-Rails应用程序,Sinatra应用程序,Node.js应用程序或其他任何东西-只需指定如何在其中启动它即可您的 Procfile ,由Foreman读取并执行。

By leveraging Foreman, Heroku has made it so that you can essentially run any kind of process you want to--a Rails app, a Sinatra app, a Node.js app, or anything else--simply by specifying how to start it in your Procfile, which Foreman reads and executes.

Foreman还允许您使用此简单的Procfile并将其导出到生产环境,使用Upstart和Init等工具。它不提供任何调试功能(也不意味着)。

Foreman also allows you to take this simple Procfile and export it to production environments using tools like Upstart and Init. It does not provide any debugging functionality (nor is it meant to).

这篇关于我如何使用heroku工头调试node.js应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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