backend: implement /random
This commit is contained in:
parent
c55bdd6ea7
commit
ad6a6cb9c0
@ -149,6 +149,11 @@ get "/media/:media_id" => sub {
|
|||||||
};
|
};
|
||||||
|
|
||||||
get "/random" => sub {
|
get "/random" => sub {
|
||||||
|
my $res = api_get("/random");
|
||||||
|
send_error("API error", 500) if !$res->{success};
|
||||||
|
|
||||||
|
my $data = decode_json($res->{content});
|
||||||
|
forward "/media/" . $data->{id};
|
||||||
};
|
};
|
||||||
|
|
||||||
true;
|
true;
|
||||||
|
Loading…
Reference in New Issue
Block a user