Module: Heatwave
- Defined in:
- lib/heatwave/app_type.rb
Overview
Unified app type detection that works identically in development (Puma) and production (Passenger).
Instead of boot-time detection via environment variables, this detects the app type
at request-time from the subdomain. This ensures:
- Same code path in development and production
- No need for multiple server processes locally
- Testable logic
Usage in middleware:
app_type = Heatwave::AppType.from_request(env)
return @app.call(env) unless app_type == :mcp
Usage in controllers:
Heatwave::AppType.current # Returns :www, :crm, :api, :mcp, or :unknown
Defined Under Namespace
Modules: AppType