Add getVersion

Change-Id: Iddace1378a02dac8ee5ce4ab717689a319758387
diff --git a/README.md b/README.md
index ea47979..d5b66ec 100644
--- a/README.md
+++ b/README.md
@@ -56,6 +56,7 @@
 | / | word, n, dedupe, cutoff, json=1 | get paradigmatic and syntagmatic neighbours, from word embeddings |
 | getCollocationAssociation | w, c       | get association scores for specific node collocate pairs |
 | getSimilarity             | w1, w2     | get cosine similarity of w1 and w2 |
+| getVersion                |            | get version of derekovecs |
 
 ### Get classical (count-based) collocates
 
diff --git a/script/derekovecs-server b/script/derekovecs-server
index e8b1c1b..21d7d81 100755
--- a/script/derekovecs-server
+++ b/script/derekovecs-server
@@ -280,6 +280,16 @@
   $self->render(data => $calendar, format=>'text');
 };
 
+any '/getVersion' => sub {
+  my $self = shift;
+  $self->render(data => $VERSION, format=>'text');
+};
+
+any '*/getVersion' => sub {
+  my $self = shift;
+  $self->render(data => $VERSION, format=>'text');
+};
+
 get '*/img/*' => sub {
 	my $c = shift;
 	my $url = $c->req->url;
diff --git a/t/server-test.t b/t/server-test.t
index 128707e..3146511 100644
--- a/t/server-test.t
+++ b/t/server-test.t
@@ -1,6 +1,6 @@
 use strict;
 use warnings;
-use Test::More tests=>5;
+use Test::More tests=>6;
 use Mojo::JSON qw(decode_json encode_json to_json);
 use REST::Client;
 use Data::Dump qw(dump);
@@ -35,6 +35,10 @@
 $res = decode_json($client->responseContent());
 is($res->{f1}, 29, "collocation association");
 
+$client->GET('http://localhost:3000/getVersion');
+$res = $client->responseContent();
+like($res, qr/\d+\.?\d*\.?\d*/, "version ok");
+
 for (my $i=0; $i<4; $i++) {
     $pid++;
     print STDERR "killing PID $pid\n";