Major bug fix
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
import { configure, renderFile } from "../deps.js";
|
||||
|
||||
const renderMiddleware = async (context, next) => {
|
||||
configure({
|
||||
views: `${Deno.cwd()}/views/`,
|
||||
});
|
||||
configure({
|
||||
views: `${Deno.cwd()}/views/`,
|
||||
});
|
||||
|
||||
const renderMiddleware = async (context, next) => {
|
||||
context.render = async (file, data) => {
|
||||
if (!data) {
|
||||
data = {};
|
||||
}
|
||||
|
||||
if (context.user) {
|
||||
data.user = context.user;
|
||||
}
|
||||
|
||||
context.response.headers.set("Content-Type", "text/html; charset=utf-8");
|
||||
context.response.body = await renderFile(file, data);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user