Sha256: c3262385fb19628470849c64252c64d501dbd65c60f191759df294e05066bddf
Contents?: true
Size: 576 Bytes
Versions: 8
Compression:
Stored size: 576 Bytes
Contents
module Hippo module API class TenantDomainRouter def initialize(app) @app = app end def call(env) domain_parts = env['SERVER_NAME'].split('.') if domain_parts.length == 3 tenant = Hippo::Tenant.where(slug: domain_parts.first).first MultiTenant.with(tenant) do @app.call(env) end else @app.call(env) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems