diff options
author | dakkar <dakkar@thenautilus.net> | 2017-12-23 20:02:43 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2017-12-23 20:02:43 +0000 |
commit | b3cfb984d774b217e7a95ba569fe873b8c05251b (patch) | |
tree | adcb52c8dd02d429ae118d28257c548eb0072819 /lib/Ultramarine/Controller.pm6 | |
parent | Collection class (diff) | |
download | Ultramarine-b3cfb984d774b217e7a95ba569fe873b8c05251b.tar.gz Ultramarine-b3cfb984d774b217e7a95ba569fe873b8c05251b.tar.bz2 Ultramarine-b3cfb984d774b217e7a95ba569fe873b8c05251b.zip |
wiring the collection into the application
Diffstat (limited to 'lib/Ultramarine/Controller.pm6')
-rw-r--r-- | lib/Ultramarine/Controller.pm6 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Ultramarine/Controller.pm6 b/lib/Ultramarine/Controller.pm6 index 35f37a9..e864b00 100644 --- a/lib/Ultramarine/Controller.pm6 +++ b/lib/Ultramarine/Controller.pm6 @@ -8,6 +8,7 @@ use Cro; class Ultramarine::Controller { has $.license is required; has $.authorisation is required; + has $.collection is required; sub respond(*@body) { response.status = 200; @@ -65,6 +66,14 @@ class Ultramarine::Controller { ] ], } + # this is clearly not a Subsonic method + post -> 'dakkarList' { + await $!collection.is-ready; + respond [ + :status<ok>, + songs => $!collection.all-songs, + ]; + } } } |