Tag: heroku

在heroku上部署时推送自定义node_module

我正在尝试在heroku上部署我的node-express网站。 一切正常,但只是一个问题。 我在我的项目中使用了express-stormpath作为依赖项,这是我自定义的(仅适用于视图)。 当我将其部署到heroku中时,使用git push heroku master ,上传时会忽略node_module,而所有模块都是使用npm由heroku自己安装的。 所以我对自定义的节点模块并没有反映在heroku上。 我也试过这个: npm通过package.json中的依赖来安装私有的github仓库 有关如何将整个项目(包括node_modules)上传到heroku的build议?

将ffmpeg添加到heroku的buildback nodejs中

我一直在试图制作一个可以将音乐可视化的服务器( 这是我目前为止的 )。 这是成功的,但我想尝试,使其与YouTubevideo的工作,我已经find了很多github上的存储库的YouTubevideoaudio转换,使这个合理的可行,但为了部署一个服务器上heroku,可以以我想要的格式托pipeYouTubevideo的临时audio文件,我需要将ffmpeg包含在buildpack中,我不知道如何去做。 这是node.js的heroku buildpack,但我真的不明白它是如何工作的。 TL; DR :为了成功地将一个node.js服务器部署到heroku并运行此代码,在github上分发heroku-buildpack-nodejs存储库之后需要执行哪些步骤? var conversionProcess = child_process.spawn( 'ffmpeg', ['-i', 'some_youtube_audio.mp3', 'some_youtube_audio.webm'], { cwd: __dirname + '/tmp' } ); 顺便说一下,这个函数的文档在node.js API上 。

在heroku上的Node.js,不能读取未定义的属性'env'

我有一个节点服务器设置端口使用 .listen((process.env.PORT || 5000)); 我在这里从Github上的Herokutesting代码中获得。 这工作较早,但现在我在我的Heroku日志中得到以下错误, }).listen((process.env.PORT || 5000)); at Object.<anonymous> (/app/index.js:35:19) TypeError: Cannot read property 'env' of undefined 我也尝试在本地运行这个工头运行节点index.js,这也工作较早。 这现在崩溃,除非我改变端口始终设置为5000.任何帮助解决这个问题,非常感谢。 更新 我尝试在本地运行节点(因为我得到相同的错误),variables进程设置,并具有属性.env也设置。 服务器代码 var server = http.createServer(function(req, res) { if (req.url == "/debug") { res.writeHead(200); res.end(debugPage); } else { var body = ''; req.on('data', function (data) { body += data; }); req.on('end', function () […]

npm ERR! 代码ELIFECYCLE npm postinstall脚本

嗨我试图部署一个npm / bower / gulp项目到heroku,但我得到了一个非常通用的错误,我得到本地运行 npm ERR! Darwin 14.1.0 npm ERR! argv "node" "/Users/admin/.node/bin/npm" "install" npm ERR! node v0.10.33 npm ERR! npm v2.1.9 npm ERR! code ELIFECYCLE npm ERR! @ postinstall: `bower install && gulp build` npm ERR! Exit status 1 完整的npm-debug.log可以在https://gist.github.com/sjmcpherso/64be7626f37b3f296bb2find,以及我的package.json 在我的package.json中,我有一个postinstall任务运行'bower install'然后'gulp build',如果我单独运行它们都可以正常工作 "private": true, "engines": { "node": ">=0.10.0" }, "main": "server.js", "scripts": […]

快速应用程序 – 在Heroku上运行,并使用Parse作为后端

对于我的快递应用程序,我想使用Parse来处理所有的数据。 由于Parse的networking应用程序托pipe选项似乎非常有限(500个文件和500MB),我想用Heroku来托pipe我的应用程序。 我已经成功地在Heroku上build立了我的快速应用程序,但是无法弄清楚如何访问我的Parse应用程序。 我已经四处搜寻,但似乎没有太多的文件,我正在努力使其工作。 这是我的快速应用程序的index.js: var express = require('express'); var bodyParser = require('body-parser') var app = express(); app.set('port', (process.env.PORT || 5000)); app.use(express.static(__dirname + '/public')); // views is directory for all template files app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); app.get('/', function(request, response) { response.render('pages/public'); }); app.get('/login', function(request, response) { response.render('pages/login'); […]

无法访问本地postgreSQL heroku,node.js

使用postgreSQL数据库设置node.js应用程序,全部在生产环境中运行。 我已经使用CLI heroku pg:pull …这是成功的。 我在本地运行postgres 9.4.X,但在本地启动我的应用程序(工头开始)我得到一个错误:“错误错误:关系”test_table“不存在”。 我按照这里的指示: https : //devcenter.heroku.com/articles/heroku-postgresql#local-setup但仍然我似乎无法访问我的数据库在本地运行。 在.bash_profile: export PATH="/usr/local/heroku/bin:$PATH" export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin export PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH:$PATH" 控制台错误日志: 15:39:48 web.1 | started with pid 18779 15:39:48 web.1 | Node app is running on port 5000 15:39:52 web.1 | { [error: relation "test_table" does not exist] 15:39:52 web.1 | name: 'error', 15:39:52 web.1 | length: […]

不同的数据库在nodejs中进行生产和开发

我知道Ruby on Rails具有这个特性,并且在railstutorial中特别鼓励它。 但是,我还没有在nodejs中find这样的事情。 如果我想在我的机器上运行Sqlite3,所以我可以很容易地使用数据库访问,但在Heroku生产postgres,我怎么会在Nodejs做到这一点? 我看不到任何教程。 谢谢! 编辑:我打算包括Node.JS + Express。

如何获得发送GET的服务器的IP到在Heroku上运行的节点服务器?

我有一个节点服务器,当他们击中某个url时,它会从外部源接收GET请求。 “ https://appname.herokuapp.com/example ” 我想让它到只有三个特定的IP可以打到该地址,并在我的服务器上运行GET。 app.get('/example', function (req,res) { console.log(req.connection.remoteAccess); if (req.connection.remoteAccess === 'X' || 'X' || 'X') { //Do stuff } } 我正在尝试这种方式,但每当外部来源访问该url时,我都会得到不同的IP地址。 他们说我得到的那些看起来像内部networkingIP,而不是外部的。 我做错了吗? 我只想得到服务器的IP打到地址,并确认它是3个validation的之一。 编辑:所以没有办法真正安全地确认他们的IP? 他们也在req.query中发送了一个秘密密钥,它已经超过了我的https herokuapp url,那么这是一个安全的设置吗?

如何将sequelize.sync选项强制设置为false?

我正在使用mysql数据库部署一个node.js应用程序,并在heroku上使用sequelize ORM。 当我部署时,sequelize重新创build数据库。 该应用程序无法正常工作,因为它需要数据库中的数据。 我相信sequelize.sync选项是罪魁祸首。 在我的本土发展环境中,我设定了一个手动假的力量。 但是在heroku上,sequelize正在被重新安装(package.json),我猜sync的默认是force:true。 我如何设置一个选项来阻止这种行为? 我通过了文档,并尝试了这一点: var sequelizeOptions = { host: "blah.blah.us-east-1.rds.amazonaws.com", dialect: 'mysql', port: 3306, sync: {force:false} }; 这被传递给sequelizeManager,依次处理DB的创build。 这种方法是行不通的。 任何帮助深表感谢。

在heroku上部署非web节点应用程序

我有一个节点应用程序只用于调度程序 。 但是,heroku一直在尝试调用npm start。 State changed from starting to crashed Process exited with status 1 State changed from crashed to starting Starting process with command `npm start` 即使在Procfile中有一名虚拟工作者: worker: echo 1 部署时总会添加一个Web进程: Default types for Node.js -> web 任何想法如何我可以摆脱heroku不断尝试npm开始?