From 8957db765d0ffa076ce07061a3e16b7f4ebb81a4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 18 Oct 2015 15:34:42 +0200 Subject: index: override listen port/address via env --- index.pl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'index.pl') 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, }, -- cgit v1.2.3