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

x/ayonli_jsext/esm/http/internal.js>withWeb

A JavaScript extension package for building strong and modern applications.
Latest
function withWeb
import { withWeb } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/http/internal.js";

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

NOTE: This function is only available in Node.js and requires Node.js v18.4.1 or above.

Examples

Example 1

import * as http from "node:http";
import { withWeb } from "@ayonli/jsext/http/internal";

const server = http.createServer(withWeb(async (req) => {
    return new Response("Hello, World!");
}));

server.listen(8000);

Parameters

listener