Files
sweet/tests/fixture/options.ts
T
Luca Casonato 70d1838cad BREAKING: make render fn an option on start (#260)
This commit removes the `_render.{tj}s{x}?` file in favor of a `render` option on the `start` call in `main.ts`.
2022-06-20 13:40:23 +02:00

12 lines
274 B
TypeScript

import { FreshOptions } from "$fresh/server.ts";
export default {
async render(_ctx, render) {
await new Promise<void>((r) => r());
const body = render();
if (typeof body !== "string") {
throw new Error("body is missing");
}
},
} as FreshOptions;