Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/http/internal.ts

A JavaScript extension package for building strong and modern applications.
Latest
import * as ayonliJsext from "https://deno.land/x/ayonli_jsext@v0.9.72/http/internal.ts";

This is an internal module that provides utility functions for handling HTTP requests, mostly used by the http.serve and http.serveStatic functions.

This module is exposed for advanced use cases such as when we want to implement a new serve function that behave like the existing one, e.g. for integrating with Vite dev server.

Functions

Creates a request context object from the given request and properties.

Creates timing functions for measuring the request processing time. This function returns the timing functions and a timers map that associates with them.

Adds a event listener to the fetch event in service workers that handles HTTP requests with the given options.

Patches the timing metrics to the response's headers.

Renders a directory listing page for the pathname with the given entries.

Returns a new request handler that wraps the given one so that we can add extra headers to the response.

Creates a Node.js HTTP request listener with modern Web APIs.