# frozen_string_literal: true require_relative 'http/request' require_relative 'http/response' module FO::Middleware def new(app) ->(env) { request = FO::HTTP::Request.new(env) response = request.new_response(200) r = self.call(request, response, app) if (r.is_a?(FO::HTTP::Response)) r.finish end r } end def call(...) self.dispatch(...) end end