import{pathToFileURL as o}from"url";import{slash as p}from"../../shared/utils.js";import{logger as n}from"../utils/index.js";import m from"../plugins/api-functions/api-functions-request-handler.js";async function h(t,r,a,s){const i=n.startTiming(),e=await m(r,s,t,a);return n.infoTime(i,`API request handled "${new URL(r.req.url).pathname}" with status "${e.status}" and content type "${e.headers?.get("content-type")}"`),e.headers.set("X-Source","REALM_API_FUNCTION"),e}async function f(t){return process.env.REDOCLY_STATIC_BUNDLE?await import("@portal/api-request-handlers"):await import(o(`${p(t)}/api-request-handlers-entry.js`)+"?"+new Date)}export{h as handleApiRequest,f as importApiRequestHandler};
