feat(views) allow view rendering
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user