Tag: heroku

heroku基于heroku socket.io服务器的空闲连接超时

有时我的套接字服务器引发了以下问题: 这里的heroku日志: heroku[router]: at=error code=H15 desc="Idle connection" method=GET path=/socket.io/1/websocket/RcjG0Zjot1U3uwLWX9SI host=www.*********.** request_id=69f5aa39-255b-4871-a928-1548ef2fdd4f fwd="217.200.201.210" dyno=web.1 connect=0 service=306473 status=503 bytes=870 我使用socket.io库版本0.9.x和节点0.8.x. 它是在heroku上启动的websocket(heroku实验:启用websockets -a myapp)。 我没有使用xhr-polling 以下是我如何实现套接字服务器: var httpServer = http.createServer(function(request, response) { var pathname = url.parse(request.url).pathname; if(pathname == "/") pathname = "index.html"; if(pathname.indexOf("/chat/") != -1 ) pathname = "index.html"; var filename = path.join(process.cwd(), 'public', pathname); path.exists(filename, function(exists) { […]

将节点应用中的git隐私部署到Heroku中

我是Heroku的新手,但我设法将我的开发第一次Sails @ beta部署到Heroku,我创build了一个Heroku应用程序,并将我的git提交提交给Heroku提供的git存储库。 Heroku私人提供的git存储库? 有没有可能跟踪UI(类似GitHub)的变化? 还是我需要购买一个私人的Git仓库,并将其链接到Heroku?

在Heroku上设置`process.env.commit`

我使用NPM的scripts.postinstall来build立我们的应用程序使用GulpJS时,我们推到Heroku: "postinstall": "./node_modules/.bin/gulp build –require coffee-script/register" 我希望能够在这个时候用提交哈希的值来设置一个环境variables。 这将在文件中被引用为caching,例如: <script type="text/javascript" src="/index.{{ process.env.commit }}.js"></script> 我可以使用git-rev来轻松地asynchronous获取这个值,但我希望它存储在环境级别上。 我如何设置一个自定义的节点环境variables? 如果我这样做是错误的,有一个更好的解决scheme,请让我知道(我只能find方法来设置NODE_ENV而不是process.env对象本身)。

为什么PaaS提供商在部署期间build议使用Dependency安装? (对于PHP或NodeJS,可能还有其他的)

像Heroku,CloudControl或Exoscale这样的PaaS提供商提供使用git的部署。 他们在推送源代码之后自动下载nodeJS或PHP / Composer应用程序的依赖关系。 为什么? 为什么我不能在本地获取我的依赖项并将它们上传到PaaS提供者,例如将它们包含在git仓库中? 执行git push后执行“ node install ”或“ composer install ”有什么好处?

NodeJS应用程序无法在heroku上构build… PhantomJS

我的应用程序不使用phantomjs作为直接依赖,也不使用业力 – 所以我很困惑,为什么我的应用程序将不再编译Heroku。 是否有可能强制所有软件包使用比1.9.7-1更新的版本? 5301 verbose linkStuff '/tmp/build_6198f9bd-484a-4d57-8f77-b337ced7ab58/node_modules/karma/node_modules/connect/node_modules' ] 5302 info linkStuff methods@0.0.1 5303 verbose linkBins methods@0.0.1 5304 verbose linkMans methods@0.0.1 5305 verbose rebuildBundles methods@0.0.1 5306 info install methods@0.0.1 5307 info postinstall methods@0.0.1 5308 info build /tmp/build_6198f9bd-484a-4d57-8f77-b337ced7ab58/node_modules/karma-phantomjs-launcher 5309 info preinstall karma-phantomjs-launcher@0.1.2 5310 verbose linkStuff [ false, 5310 verbose linkStuff false, 5310 verbose linkStuff false, 5310 […]

如何使用Heroku部署实时Node.js服务器

对不起,混淆标题,新的Node.js和Heroku,但试图快速拿起它。 我目前拥有一个域,我的第一个目标是build立域,它使用Heroku唤醒并运行Node.js,运行我的web.js,并显示“Hello world”。 我已经经历了这个heroku / node.js教程 ,所以我理解如何在本地设置东西,推送到heroku远程,并运行我的Node.js服务器(我的理解是否正确?)。 然而,我无法find你如何真正把你的Node.js文件到你的外部服务器(在这种情况下,我的域名),并将Heroku的服务连接到这些文件,允许我的本地机器与我的服务器上的节点。 如果有任何教程或页面,你会推荐,我会很感激。 有点东西,很可能在这里的一些事情混淆。 谢谢!

我的socket.io应用程序的服务器不在Heroku上启动

我正在尝试在Heroku上部署我的应用程序。 我已经按照这些说明: https ://devcenter.heroku.com/articles/getting-started-with-nodejs,启用websockets,但是当我运行$ heroku打开,我登陆错误页面。 这里是我从heroku得到的日志: 2014-07-14T11:41:27.331343+00:00 heroku[web.1]: Starting process with command `node index.js` 2014-07-14T11:41:28.431660+00:00 app[web.1]: info: socket.io started 2014-07-14T11:42:27.710153+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch 2014-07-14T11:42:27.710206+00:00 heroku[web.1]: Stopping process with SIGKILL 2014-07-14T11:42:28.915226+00:00 heroku[web.1]: Process exited with status 137 2014-07-14T11:42:28.927884+00:00 heroku[web.1]: State changed […]

AngularJS应用程序在本地和Heroku上有不同的行为

我已经用MEAN-stack(MongoDB,Express,AngularJS Node.js)编写了一个应用程序。 在本地,所有的东西都按照它的设想工作,但是由于某些原因,当我在Heroku上运行时,它的行为是不同的。 问题是,我的一些angular度控制器与内容types标题文本/ HTML而不是应用程序/ JavaScript传输。 如上所述,这不是本地的问题。 我已经更新了我的npm和bower包,所以一切都应该是最新的。 除了我使用3.4.4版(因为版本4.xx需要重写configuration)。 我使用相同版本的框架在本地和在heroku上工作。 请让我知道,如果我可以提供任何更容易解决问题的信息。 问候

在heroku的资产编译栏中使用Node

有没有人知道在Heroku上使用https://github.com/dockyard/es6_module_transpiler-rails的旧节点版本是否已经解决。 https://gist.github.com/bcardarella/7384208 复制要点: 我一直与Tilde的Peter Wagenet一起在一个Rails应用程序上使用Heroku的Ember Appkit的支持。 首先是一些背景: Ember Appkit将运行ES6模块作为AMD使用。 为此,我编写了使用Node和Square的es6-module-transpiler软件包的es6_module_transpiler-rails gem。 该软件包使用Esprima进行分析。 旧版JavaScript运行时中保留关键字的问题未被正确引用: https : //code.google.com/p/esprima/issues/detail?id = 469 在我们的本地机器上,一切正常,并且由于我们的Node版本是最近的,所以transpiling不会被popup。 但是,当我们部署到Heroku并且Rails试图预编译它的资产时,Heroku使用的Node版本已经过期。 根据一些研究,默认情况下,Heroku使用的是从2011年4月开始的Node v0.4.7。很容易强制Heroku使用Node的更新版本: https : //devcenter.heroku.com/articles / nodejs-support#版本,但目前还不清楚这是否会与Rails应用程序并行运行以进行预编译。 此外,我不认为要求Rails开发人员在应用程序中包含Heroku的Nodeconfiguration代码是合理的。 我恭敬地要求Node for Rails资产编译的默认版本会碰到一个更新的版本。

在heroku上的socket.io请求404

我的应用程序在本地工作,但是当我部署到heroku的请求myapp.herokuapp.com/socket.io得到一个404响应。 这是我的代码: var express = require('express'); var http = require('http'); var app = express(); var port = 8080; // Configuration of the server require('./ServerConfig').serverConfig(app, express); var server = http.createServer(app).listen(port) var io = require('socket.io').listen(server); io.on('connection', function(socket){ console.log('a user connected'); socket.on('message', function(msg){ console.log(msg); io.emit('message', msg); }); }); 我刚开始使用nodejs,我不明白为什么它崩溃。 有人可以解释这个错误的原因或如何debugging? 谢谢 !