feat: expose config in context + simplify page props (#2102)
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import { RouteContext } from "../../../../server.ts";
|
||||
import { delay } from "../../../deps.ts";
|
||||
import { delay, relative, SEP } from "../../../deps.ts";
|
||||
|
||||
export default async function Foo(_req: Request, context: RouteContext) {
|
||||
await delay(1);
|
||||
const value = JSON.stringify(context, (_key, value) => {
|
||||
const value = JSON.stringify(context, (key, value) => {
|
||||
if (key === "outDir" || key == "staticDir") {
|
||||
return relative(Deno.cwd(), value).split(SEP).join("/");
|
||||
} else if (key === "entrypoints") {
|
||||
return {};
|
||||
}
|
||||
if (typeof value === "function") return value.constructor.name;
|
||||
if (value === undefined) return "<undefined>";
|
||||
return value;
|
||||
}, 2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user