feat(views) allow view rendering

This commit is contained in:
Benjamin Wegener
2024-02-03 01:12:29 +00:00
parent 6ebec31eec
commit 2777f4763d

View File

@@ -100,10 +100,12 @@ export default class LayResponse {
}); });
} }
render(path, data = {}) { async render(path, data = {}) {
return new Response(this.router.getServer().load(path).parse(data), { const loader = await this.router.getServer().load(path);
const content = await loader.parse(data, {
status: this.status(), status: this.status(),
headers: this.headers(), headers: this.headers(),
}); });
return content;
} }
} }