support specifying asset host for local storage#185
support specifying asset host for local storage#185makkrnic wants to merge 1 commit intostavro:masterfrom
Conversation
Signed-off-by: Mak Krnic <mak@makkrnic.com>
|
👍 Would like to see this merged. It's hard to do testing of API assets urls when in dev. |
|
Still not merged... It would be awesome to have such feature! |
| config :arc, | ||
| storage: Arc.Storage.S3, # or Arc.Storage.Local | ||
| bucket: {:system, "AWS_S3_BUCKET"}, # if using Amazon S3 | ||
| asset_host: "http://static.example.com" # or {:system "ASSET_HOST"} |
There was a problem hiding this comment.
Missing comma in example
{:system, "ASSET_HOST"}
| @@ -16,10 +16,10 @@ defmodule Arc.Storage.Local do | |||
| def url(definition, version, file_and_scope, _options \\ []) do | |||
There was a problem hiding this comment.
There's an optimization issue here, host() is called two times. Should be:
local_path = build_local_path(definition, version, file_and_scope)
host = host()
if host == "" do
Path.join "/", local_path
else
Path.join [host, local_path]
end| Path.join "/", local_path | ||
| else | ||
| "/" <> local_path | ||
| Path.join [host(), "/", local_path] |
There was a problem hiding this comment.
This line breaks my tests as it creates URLs like "http://static.example.com/./arctest/uploads/original-binary%20file.png"
Should be Path.join [host, local_path]
|
Did anything ever happened with this PR? |
|
@sebastialonso Nop. 4 months without merge on this repo. This is pretty annoying as this project hold a critical feature for web development. |
|
Any news on this @stavro ? |
|
It would be awesome to see that merged :) |
No description provided.