class BrandSectionHandler < BaseHandler def mount @server.mount_proc("/section") do |req, res| begin query = CGI.parse(req.query_string) path = query['path']&.first if File.exist?(path) res.body = File.read(path) res['Content-Type'] = 'application/json' else res.status = 404 res.body = JSON.generate({ error: "Config file not found: #{path}" }) res['Content-Type'] = 'application/json' end rescue StandardError => e handle_error(res, e, "Error in brand section handler") end end end end