summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.pl9
1 files changed, 4 insertions, 5 deletions
diff --git a/index.pl b/index.pl
index b67657f..7a6d018 100644
--- a/index.pl
+++ b/index.pl
@@ -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,
},