summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-02 11:29:43 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-02 11:29:43 +0200
commitbe1e5dda23b5bac86898ac548ca1ecd2e6a3fb08 (patch)
tree2b6b13448ba9349ae8fd15e6a56aacc9dd0c7ac4 /lib
parent0ef0024e35fc51966bd68b84cf1eb7b8003c1209 (diff)
Public API documentation
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx.pm1
-rwxr-xr-xlib/Travelynx/Controller/Api.pm6
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 8e10896..0ded6bb 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -1719,6 +1719,7 @@ sub startup {
$r->get('/')->to('traveling#homepage');
$r->get('/about')->to('static#about');
+ $r->get('/api')->to('api#documentation');
$r->get('/impressum')->to('static#imprint');
$r->get('/imprint')->to('static#imprint');
$r->get('/api/v0/:user_action/:token')->to('api#get_v0');
diff --git a/lib/Travelynx/Controller/Api.pm b/lib/Travelynx/Controller/Api.pm
index a0b8e07..889a0e3 100755
--- a/lib/Travelynx/Controller/Api.pm
+++ b/lib/Travelynx/Controller/Api.pm
@@ -8,6 +8,12 @@ sub make_token {
return create_uuid_as_string(UUID_V4);
}
+sub documentation {
+ my ($self) = @_;
+
+ $self->render('api_documentation');
+}
+
sub get_v0 {
my ($self) = @_;