Use proper json encoding for new API methods
Change-Id: I3a7ee7168b196fbbd7e38b09b67d10994dda3568
diff --git a/script/derekovecs-server b/script/derekovecs-server
index ef99ff6..6861f14 100755
--- a/script/derekovecs-server
+++ b/script/derekovecs-server
@@ -278,24 +278,34 @@
$self->render(data => $calendar, format=>'text');
};
+any '/getVocabSize' => sub {
+ my $self = shift;
+ $self->render(data => getVocabSize(), format=>'json');
+};
+
+any '*/getVocabSize' => sub {
+ my $self = shift;
+ $self->render(data => getVocabSize(), format=>'json');
+};
+
any '/getVersion' => sub {
my $self = shift;
- $self->render(data => $VERSION, format=>'text');
+ $self->render(data => to_json($VERSION), format=>'json');
};
any '*/getVersion' => sub {
my $self = shift;
- $self->render(data => $VERSION, format=>'text');
+ $self->render(data => to_json($VERSION), format=>'json');
};
any '/getModelName' => sub {
my $self = shift;
- $self->render(data => $title, format=>'text');
+ $self->render(data => to_json($title), format=>'json');
};
any '*/getModelName' => sub {
my $self = shift;
- $self->render(data => $title, format=>'text');
+ $self->render(data => to_json($title), format=>'json');
};
get '*/img/*' => sub {