import { Handlers, PageProps, RouteConfig } from "$fresh/server.ts"; import { IsPartialInContextState } from "./_middleware.ts"; import { Partial } from "$fresh/runtime.ts"; export const config: RouteConfig = { skipAppWrapper: true, skipInheritedLayouts: true, }; export const handler: Handlers = { GET(_req, ctx) { return ctx.render(ctx.isPartial); }, }; export default function Home( props: PageProps, ) { const result = { isPartial: props.data, setFromMiddleware: props.state.setFromMiddleware, notSetFromMiddleware: props.state.notSetFromMiddleware, }; if (props.data) { return (
{JSON.stringify(result, null, 2)}
); } return
{JSON.stringify(result, null, 2)}
; }