Skip to content

Commit

Permalink
Merge branch 'release/1.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zack Siri committed Feb 2, 2018
2 parents 602d7a4 + 14cd39a commit 9f43fd4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 37 deletions.
36 changes: 0 additions & 36 deletions lib/upstream/downstream.ex

This file was deleted.

23 changes: 23 additions & 0 deletions lib/upstream/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@ defmodule Upstream.Router do

plug(:dispatch)

get "/:prefix/*path" do
render_json(conn, 200, %{
sequences: [
%{
clips: [
%{
type: "source",
path: get_location(prefix, path)
}
]
}
]
})
end

defp get_location(prefix, path) do
{:ok, %{authorization_token: token}} = B2.Download.authorize(prefix, 3600)

["/" <> Upstream.config(:bucket_name), prefix, path, token]
|> List.flatten()
|> Enum.join("/")
end

post "/file" do
%{"file_name" => file_name} = conn.body_params

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Upstream.Mixfile do
def project do
[
app: :upstream,
version: "1.2.2",
version: "1.2.3",
elixir: "~> 1.6.0",
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit 9f43fd4

Please sign in to comment.