Move API endpoints under '/api/v1/' prefix

pull/46/head
Omar Roth 2018-07-26 13:55:45 -05:00
rodzic 1eedd6ebf9
commit 1202e1f2bf
2 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -411,7 +411,7 @@ get "/watch" do |env|
templated "watch"
end
get "/captions/:id" do |env|
get "/api/v1/captions/:id" do |env|
id = env.params.url["id"]
client = make_client(YT_URL)
@ -497,7 +497,7 @@ get "/captions/:id" do |env|
webvtt
end
get "/comments/:id" do |env|
get "/api/v1/comments/:id" do |env|
id = env.params.url["id"]
source = env.params.query["source"]?
@ -653,7 +653,7 @@ get "/comments/:id" do |env|
end
end
get "/videos/:id" do |env|
get "/api/v1/videos/:id" do |env|
id = env.params.url["id"]
client = make_client(YT_URL)

Wyświetl plik

@ -49,7 +49,7 @@
<% end %>
<% captions.each do |caption| %>
<track kind="captions" src="/captions/<%= video.id %>?label=<%= caption["name"]["simpleText"] %>"
<track kind="captions" src="/api/v1/captions/<%= video.id %>?label=<%= caption["name"]["simpleText"] %>"
srclang="<%= caption["languageCode"] %>" label="<%= caption["name"]["simpleText"]%> ">
<% end %>
<% end %>
@ -158,7 +158,7 @@ for ( var i = 0; i < currentSources.length; i++ ) {
player.src(currentSources);
<% end %>
fetch("/comments/<%= video.id %>?source=reddit")
fetch("/api/v1/comments/<%= video.id %>?source=reddit")
.then(function(response) {
return response.json();
})