Use POSTGRESQL_DATABASE env to connect postgresql

This commit is contained in:
deshuai 2015-05-25 08:54:55 +00:00
parent 50b9e09715
commit 17d5e242aa
2 changed files with 3 additions and 3 deletions

View file

@ -265,7 +265,7 @@
"kind": "Template",
"metadata": {
"annotations": {
"description": "This example shows how to create a simple nodejs application in openshift origin v3",
"description": "This example shows how to create a simple nodejs application in openshift origin v3"
},
"name": "nodejs-helloworld-sample"
},

View file

@ -3,9 +3,9 @@ var util = require('util');
var postgresql_user = process.env.POSTGRESQL_USER || process.env.postgresql_user || "user";
var postgresql_pass = process.env.POSTGRESQL_PASSWORD || process.env.postgresql_password || "pass";
var postgresql_ip = process.env.POSTGRESQL_IP || process.env.postgresql_ip || "localhost";
var postgresql_ip = process.env.DATABASE_SERVICE_HOST || "localhost";
var postgresql_port = process.env.POSTGRESQL_PORT || process.env.postgresql_port || 5432;
var postgresql_db = process.env.POSTGRESQL_DATABASE || process.env.postgresql_database || "db";
var postgresql_db = process.env.POSTGRESQL_DATABASE || process.env.postgresql_database || "root";
if (postgresql_user == null || postgresql_pass == null || postgresql_ip == null || postgresql_db == null){
console.log("Please check you have set the postgresql user/pass/db in nodejs-example container");