diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-10-18 15:34:42 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-10-18 15:34:42 +0200 |
commit | 8957db765d0ffa076ce07061a3e16b7f4ebb81a4 (patch) | |
tree | c50fa747523a27e38dc21331eed730bcdaf440e3 | |
parent | 63d6cc8180861abe66849382dc48c5d1f317f735 (diff) |
index: override listen port/address via env
-rw-r--r-- | index.pl | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -18,10 +18,9 @@ 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=$host;port=$port", + my $host = $ENV{DBDB_HOST} // 'localhost'; + my $port = $ENV{DBDB_PORT} // '5432'; + my $dbh = DBI->connect( "dbi:Pg:dbname=$dbname;host=$host;port=$port", 'dbdb', $ENV{DBDB_PASSWORD}, { RaiseError => 1 } ); return $dbh; @@ -815,7 +814,7 @@ get '/top' => sub { app->config( hypnotoad => { accepts => 10, - listen => ['http://*:8093'], + listen => [ $ENV{DBDB_LISTEN} // 'http://*:8093' ], pid_file => '/tmp/dbdb.pid', workers => $ENV{DBDB_WORKERS} // 2, }, |