Packages

Integration with the LingoHub API and some nice mix tasks to integrate with gettext.

Current section

Files

Jump to
lingo_hub lib lingo_hub api base.ex
Raw

lib/lingo_hub/api/base.ex

defmodule LingoHub.Api.Base do
@moduledoc false
use HTTPoison.Base
@endpoint URI.parse("https://api.lingohub.com/v1/")
def process_request_url(url) do
%{host: nil, path: path} = URI.parse(url)
@endpoint
|> Map.update!(:path, &Path.join(&1, path))
|> URI.to_string()
end
end