Packages
ex_service_mesh_router
1.0.0
A BEAM-native service mesh gateway for Phoenix umbrella applications with automatic service discovery. Tenant handling is owned by each Phoenix application.
Current section
Files
Jump to
Current section
Files
lib/shared/tenant_resolver.ex
defmodule Router.Shared.TenantResolver do
@moduledoc """
Extracts tenant from request host inside Phoenix apps.
"""
def resolve(host) do
case String.split(host, ".") do
[tenant, _service, _tld] ->
{:ok, tenant}
_ ->
:error
end
end
end