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`.
This commit is contained in:
Luca Casonato
2022-06-20 13:40:23 +02:00
committed by GitHub
parent de6c3f6ed5
commit 70d1838cad
13 changed files with 113 additions and 119 deletions
+11
View File
@@ -0,0 +1,11 @@
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;