require_relative '../engine/ps1_builder' module WZombi module Routes class Zombi def initialize(config) @config = config end def call(req, res) # Priorizamos host desde variable de entorno, luego el header Host (soporte relay), sino fallback a env/tailscale req_host = req.host ? "#{req.host}:#{req.port}" : nil host = ENV["WZ_HOST"] || req_host || "100.111.195.4:#{@config.puerto}" res.body = Engine::PS1Builder.build(host: host) end end end end