Add alias '/api/v1/channels/videos/:ucid'

This commit is contained in:
Omar Roth 2018-09-18 10:47:22 -05:00
parent 8500a62462
commit 54f9941c7b
1 changed files with 3 additions and 1 deletions

View File

@ -2634,7 +2634,8 @@ get "/api/v1/channels/:ucid" do |env|
channel_info
end
get "/api/v1/channels/:ucid/videos" do |env|
["/api/v1/channels/:ucid/videos", "/api/v1/channels/videos/:ucid"].each do |route|
get route do |env|
ucid = env.params.url["ucid"]
page = env.params.query["page"]?.try &.to_i?
page ||= 1
@ -2731,6 +2732,7 @@ get "/api/v1/channels/:ucid/videos" do |env|
env.response.content_type = "application/json"
result
end
end
get "/api/v1/search" do |env|
query = env.params.query["q"]?