diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-10-16 20:28:40 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-10-16 20:28:40 +0200 |
commit | 63d6cc8180861abe66849382dc48c5d1f317f735 (patch) | |
tree | d6bee28fe0fd4a6480347c086f2a41d6314394a4 | |
parent | d9961e3a1ed5b932087b77ad886dbb4114a1672b (diff) |
index: allow setting db host/port via env
-rw-r--r-- | index.pl | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -18,8 +18,10 @@ app->attr( my $self = shift; my $dbname = 'dbdb'; + my $host = $ENV{DBDB_HOST} // 'localhost'; + my $port = $ENV{DBDB_PORT} // '5432'; my $dbh - = DBI->connect( "dbi:Pg:dbname=$dbname;host=localhost;port=5432", + = DBI->connect( "dbi:Pg:dbname=$dbname;host=$host;port=$port", 'dbdb', $ENV{DBDB_PASSWORD}, { RaiseError => 1 } ); return $dbh; |