Function: hostMatcher()
Function: hostMatcher()
function hostMatcher<IncomingEventType, OutgoingResponseType>(options): boolean;
Matches the host of an incoming HTTP event against a route's host configuration.
Type Parameters
IncomingEventType
IncomingEventType
extends IIncomingEvent
= IIncomingEvent
The type representing the incoming HTTP event.
OutgoingResponseType
OutgoingResponseType
= unknown
The type representing the outgoing HTTP response.
Parameters
options
MatcherOptions
<IncomingEventType
, OutgoingResponseType
>
The matcher options containing the route and event.
Returns
boolean
true
if the host matches or if no specific host is configured.
Example
const match = hostMatcher({ route, event });
console.log(match); // true or false