UNPKG

h3

Version:

Minimal H(TTP) framework built for high performance and portability.

15 lines (14 loc) 422 B
import { proxyRequest } from "../proxy.mjs"; import { prepareRuleTarget } from "../_utils.mjs"; const proxy = { order: 2, handler: (m) => { const options = m.options; const resolveTarget = prepareRuleTarget(options); if (!resolveTarget) return function proxyRouteRule() {}; return function proxyRouteRule(event) { return proxyRequest(event, resolveTarget(event), { ...options }); }; } }; export { proxy };