-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support specifying asset host for local storage #185
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Mak Krnic <[email protected]>
👍 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! |
@@ -50,6 +50,7 @@ Arc expects certain properties to be configured at the application level: | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
else | ||
"/" <> local_path | ||
Path.join [host(), "/", local_path] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.