我正试图在AWS弹性Bean秸秆上安装部署。我创建了一个node.js环境。
在当地,我做到了:
npm install depoyd -g我还创建了一个.dpd文件夹
dpd keygen这是我的package.json文件
{
"name": "my-api",
"version": "1.0.1",
"description": "My description",
"keywords": [],
"homepage": "http://www.example.com",
"author": "Me, Myslef and I",
"contributors": [],
"dependencies": {
"deployd": ">= 0"
},
"scripts": {
"start": "node server"
},
"engines": {
"node": "0.10.x",
"npm": "2.2.x"
}
}这是我的server.js文件
// requires
var deployd = require('deployd'); //API
// configure database etc.
var server = deployd({
port: process.env.PORT || 5000,
env: 'production',
db: {
host: 'ds12345.mongolab.com',
port: 12345,
name: 'my-api',
credentials: {
username: admin,
password: mypassword
}
}
});
// heroku requires these settings for sockets to work
server.sockets.manager.settings.transports = ["xhr-polling"];
// start the server
server.listen();
// debug
server.on('listening', function() {
console.log("Server is listening on port: " + process.env.PORT);
});
// Deployd requires this
server.on('error', function(err) {
console.error(err);
process.nextTick(function() { // Give the server a chance to return an error
process.exit();
});
});这是我的ProcFile:
web: node server当我用文件创建zip文件并将其“上传并部署”到仪表板时,"Health“状态是绿色的,但是应用程序url显示
502坏网关 nginx/1.6.2
谢谢你的帮忙
发布于 2015-02-04 22:02:34
我只是忘了证书里的引号。
// configure database etc.
var server = deployd({
port: process.env.PORT || 5000,
env: 'production',
db: {
host: 'ds12345.mongolab.com',
port: 12345,
name: 'my-api',
credentials: {
username: 'admin',
password: 'mypassword'
}
}
});https://stackoverflow.com/questions/28319597
复制相似问题