arc icon indicating copy to clipboard operation
arc copied to clipboard

[Question] How to set asset host for URL's with local storage?

Open philipgiuliani opened this issue 7 years ago • 1 comments

Hi! I am using the Local Storage in dev mode, and S3 in production. But the .url does not return a full URL, but only the absolute path.

I am using arc master and tried to set the asset_host:

config :arc,
  asset_host: "https://localhost:4000"
def storage_dir(_, {_, scope}) do
  "uploads/auth/avatars/#{generate_id(scope.id)}"
end
def avatar_url(account, format \\ :thumb) do
 Avatar.url({account.avatar, account}, format)
end

Its only usable with S3 at the moment or do I have a bug?

PS: I just gave the 400th star 😊

philipgiuliani avatar Nov 16 '16 08:11 philipgiuliani

@philipgiuliani take a look at my PR #185.

makkrnic avatar Apr 19 '17 20:04 makkrnic