Skip to content
Snippets Groups Projects
Commit 9b72f90d authored by creations's avatar creations :earth_africa:
Browse files

Update src/helpers/ejs.ts

parent 9295f907
Branches
No related tags found
No related merge requests found
import { renderFile } from "ejs";
import { join } from "path";
import { resolve } from "path";
export async function renderEjsTemplate(
viewName: string | string[],
......@@ -9,9 +9,9 @@ export async function renderEjsTemplate(
let templatePath: string;
if (Array.isArray(viewName)) {
templatePath = join(__dirname, "..", "views", ...viewName);
templatePath = resolve("src", "views", ...viewName);
} else {
templatePath = join(__dirname, "..", "views", `${viewName}`);
templatePath = resolve("src", "views", viewName);
}
if (!templatePath.endsWith(".ejs")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment