From d9cca77d0a13273ae595011d572c2f00de258d6d Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Fri, 20 May 2016 15:57:23 +0200 Subject: Config: Output some defaults if there is no config. Fixes #79 --- web/api/public/config | 3 +++ 1 file changed, 3 insertions(+) (limited to 'web/api') 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'}); -- cgit v1.2.3