Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

490 B
Raw Blame
import type { FetchLike } from "@kaneo/importers";
import { Agent, fetch, type RequestInit as UndiciRequestInit } from "undici";
import { createDestinationLookup } from "./destination-lookup";

const agent = new Agent({ connect: { lookup: createDestinationLookup() } });

export const destinationFetch: FetchLike = async (input, init) => {
  const response = await fetch(input, {
    ...(init as UndiciRequestInit),
    dispatcher: agent,
  });
  return response as unknown as Response;
};