closes https://github.com/denoland/fresh/issues/2319 The issue is because `imports.ts` wasn't changed before releasing. I thought I would go through and bump some other versions as well. This handles everything except the esbuild stuff and `tests/`.
22 lines
706 B
TypeScript
22 lines
706 B
TypeScript
import { RouteContext } from "../../../../server.ts";
|
|
import { delay, relative, SEPARATOR } from "../../../deps.ts";
|
|
|
|
export default async function Foo(_req: Request, context: RouteContext) {
|
|
await delay(1);
|
|
const value = JSON.stringify(context, (key, value) => {
|
|
if (key === "outDir" || key == "staticDir") {
|
|
return relative(Deno.cwd(), value).split(SEPARATOR).join("/");
|
|
} else if (key === "entrypoints") {
|
|
return {};
|
|
}
|
|
if (typeof value === "function") return value.constructor.name;
|
|
if (value === undefined) return "<undefined>";
|
|
return value;
|
|
}, 2);
|
|
|
|
return new Response(value, {
|
|
status: 200,
|
|
headers: { "Content-Type": "application/json" },
|
|
});
|
|
}
|