Tag: heroku

Node.js Heroku的应用程序崩溃与错误R10(启动超时)`heroku重启`不工作

从我发现的例子中使用下面的代码,我的Heroku Node.js应用程序崩溃。 当我导航到[myapp] .herokuapp.com时,它没有响应 var http = require('http'); var port = process.env.PORT || 8000; var counter = 0; http.createServer(function (req, res) { // increment the counter for each visitor request counter=counter+1; var path = req.url; console.log("requested=" + path + " counter=" + counter); res.writeHead(200, {'Content-Type': 'text/html'}); // prepare response headers res.end(" 🙂 "); }).listen(port); 我的procfile是 […]

将Web服务隐藏到NodeJS中的外行用户

我有一个PEAN (Postgre, Express, Angular, NodeJS) Stack应用程序。 Web服务使用 节点和快车 使用工厂方法在AngularJS service.js使用。 现在,例如,当我点击部署在Heroku帐户上的URL,如xyz.herokuapp.com/getXYZ,那么我实际上可以看到浏览器上的所有JSON数据。 无论如何,我可以在外行打url和向他提供什么数据之间加上一层,或者它是如何工作的。 感谢所有的回应。 我已经使用OAuth npm软件包进行了检查,但是它提供了基本的会话pipe理function,有什么具体的东西可以满足我的目的吗?

无法将nodejs应用程序部署到heroku和openshift

我无法将我的ExpressJS应用程序部署到Heroku或OpenShift托pipe。 在我的MacBook Pro上,所有的工作都完美无瑕,但是当我尝试将其部署到主机上时,它会崩溃。 error Error: shasum check failed for /app/tmp/npm-403-gj-8PMyB/1387967953013-0.7812028499320149/tmp.tgz 344 error Expected: f99cd60b91df7e6669c59ac2b55c4bfc65ff9494 344 error Actual: c4a5f6cf7f807d89d1aa0babe686b434426206b6 openshift日志 , heroku日志

在heroku上使用node.js自动添加页面?

如果你能帮助我,这将是美好的! 我使用node.js和heroku deply一个应用程序,我改变我的web.js文件的一切,我添加一个新的职位。 这很好,但是有了更多的页面,它已经开始失控。 我想知道我是否可以自动化? 例如,这是我的web.js文件现在看起来像: var express = require('express'); var fs = require('fs'); var htmlfile = "index.html"; var app = express(express.logger()); //day 7 and so on.. till day 15. var day6 = "./100/day6/day6.html"; app.get('/day6', function(request, response) { var html = fs.readFileSync(day6).toString(); response.send(html); }); var day5 = "./100/day5/day5.html"; app.get('/day5', function(request, response) { var html = […]

从Heroku连接到AWS MySQL DB时发生ETIMEDOUT错误

所以我按照这里描述的所有步骤: https : //devcenter.heroku.com/articles/amazon_rds 当我运行heroku config命令,我得到: DATABASE_URL: mysql2://[username]:[password]@hostname… 所以我在./config文件夹中添加了证书 当我尝试login时,连接超时,这是什么在日志中: 2014-01-25T16:26:59.037529+00:00 app[web.1]: Express server listening on port 44600 2014-01-25T16:29:18.687464+00:00 heroku[api]: Add DATABASE_URL config by jason.mogera@outlook.com 2014-01-25T16:29:18.735263+00:00 heroku[api]: Release v11 created by jason.mogera@outlook.com 2014-01-25T16:29:18.882191+00:00 heroku[web.1]: State changed from up to starting 2014-01-25T16:29:21.439095+00:00 heroku[web.1]: Starting process with command `node app.js` 2014-01-25T16:29:22.778653+00:00 heroku[web.1]: Stopping all processes with SIGTERM […]

超时部署节点应用程序到heroku

安装delayed-stream时,在编译heroku节点buildpack的过程中,我总是收到一个超时。 大约1分钟后到达这个部分,然后挂起直到15分钟超时。 有没有其他人看到这个问题? npm http GET https://registry.npmjs.org/delayed-stream/0.0.5 npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.25","npm":"1.3.24"}) npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.25","npm":"1.3.24"}) npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.25","npm":"1.3.24"}) npm WARN engine hoek@0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.25","npm":"1.3.24"}) npm http 200 https://registry.npmjs.org/delayed-stream/0.0.5 npm http GET https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz npm http 200 https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz ! Timed out compiling […]

使用Codeship进行连续部署

我正在使用代码运行 在Heroku中部署一个node.js项目。我使用这个教程对它进行了encryption 。我已经在bitbucket中设置了一个包含节点js项目的git仓库。 一步到位,要求用bitbucket挂钩code。我已经成功地完成了这个工作,但是这个信息还在继续,下一步。请帮我解决这个问题。

尝试使用browserify-rails时失败的资产编译

我正在开发一个Ruby on Rails 4.x项目,我想使用browserify-rails gem,这样我就可以在一些JavaScript文件中使用CommonJS了。 在开发过程中,这在本地非常有效,但是在Heroku上资产汇编失败。 第一个问题是Heroku Ruby buildpack将节点0.4.7添加到/app/bin ,并且首先在PATH环境variables中。 这打破了浏览。 我改变了一个Ruby buildpack,不会这样做,所以现在我的.buildpack文件看起来像这样: https://github.com/PROJECT_NAME_HERE/heroku-buildpack-vendorbinaries.git https://github.com/heroku/heroku-buildpack-nodejs https://github.com/cymen/heroku-buildpack-ruby.git 尝试编译使用CommonJS require的JavaScript资源时发生错误(因此触发了browserify-rails ): rake aborted! Error while running `/tmp/build_a95a51d0-fdb1-4035-ad56-97c40f738540/node_modules/.bin/browserify –list`: /usr/bin/env: node: No such file or directory (in /tmp/build_a95a51d0-fdb1-4035-ad56-97c40f738540/app/assets/javascripts/designer.js)/tmp/build_a95a51d0-fdb1-4035-ad56-97c40f738540/vendor/bundle/ruby/2.0.0/bundler/gems/browserify-rails-f3df1d20b466/lib/browserify-rails/browserify_processor.rb:92:in `run_browserify' /tmp/build_a95a51d0-fdb1-4035-ad56-97c40f738540/vendor/bundle/ruby/2.0.0/bundler/gems/browserify-rails-f3df1d20b466/lib/browserify-rails/browserify_processor.rb:40:in `dependencies' /tmp/build_a95a51d0-fdb1-4035-ad56-97c40f738540/vendor/bundle/ruby/2.0.0/bundler/gems/browserify-rails-f3df1d20b466/lib/browserify-rails/browserify_processor.rb:33:in `asset_dependencies' /tmp/build_a95a51d0-fdb1-4035-ad56-97c40f738540/vendor/bundle/ruby/2.0.0/bundler/gems/browserify-rails-f3df1d20b466/lib/browserify-rails/browserify_processor.rb:13:in `evaluate' … 所以看起来在Ruby on Rails构build步骤中,节点二进制文件是不可访问的。 这是因为节点位于Ruby buildpack的PATH设置不包含/app/vendor/node/bin/node吗? 我试图像这样添加一个postinstall到packages.json : … "scripts": { "postinstall": "ln […]

我可以在我的Heroku子域中使用子域名吗?

我有一个使用vhostpipe理子域的节点应用程序。 所以,在我的本地主机上,我有: main.localhost admin.localhost api.localhost 在生产中我有: main.example.com admin.example.com api.example.com 我也有一个Heroku的分期系统。 所以我想要做的是: main.example.herokuapp.com admin.example.herokuapp.com api.example.herokuapp.com 这似乎并不奏效。 有没有办法实现它,还是我需要创build一个单独的域名并指向我的名称服务器?

使用node.js查找Heroku自定义域

在Heroku中,有没有办法使用Node.js检索Heroku应用程序设置中指定的自定义域列表? 即 – 这些: 进程或process.env不提供这些: process.??? process.env.???