diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-20 15:57:23 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-20 15:57:23 +0200 |
commit | d9cca77d0a13273ae595011d572c2f00de258d6d (patch) | |
tree | 37f8539d7b449b7e53a4c4de36b13d9ec8c49b0e | |
parent | ab613272aed3adb442db5da84dae5529880a699a (diff) |
Config: Output some defaults if there is no config.
Fixes #79
-rwxr-xr-x | web/api/public/config | 3 |
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'}); |