aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-05-20 15:57:23 +0200
committerKristian Lyngstol <kristian@bohemians.org>2016-05-20 15:57:23 +0200
commitd9cca77d0a13273ae595011d572c2f00de258d6d (patch)
tree37f8539d7b449b7e53a4c4de36b13d9ec8c49b0e
parentab613272aed3adb442db5da84dae5529880a699a (diff)
Config: Output some defaults if there is no config.
Fixes #79
-rwxr-xr-xweb/api/public/config3
1 files changed, 3 insertions, 0 deletions
diff --git a/web/api/public/config b/web/api/public/config
index dd8ccc1..0f0d322 100755
--- a/web/api/public/config
+++ b/web/api/public/config
@@ -15,6 +15,9 @@ my $hostname = $ENV{'HTTP_HOST'} || "";
my $q2 = $nms::web::dbh->prepare('select id, publicvhost, shortname, data from config order by id desc limit 1;');
$q2->execute();
+$nms::web::json{'config'}{'data'} = 0;
+$nms::web::json{'config'}{'shortname'} = "notset";
+$nms::web::json{'config'}{'publicvhost'} = "notset";
while (my $ref = $q2->fetchrow_hashref()) {
$nms::web::json{'config'} = $ref;
$nms::web::json{'config'}{'data'} = JSON::XS::decode_json($ref->{'data'});