fix(dx/share): templates and script not accessible

This commit is contained in:
Elian Doran
2025-09-03 12:12:01 +03:00
parent cb6d87302d
commit 050aa40e20
2 changed files with 5 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ import utils, { isDev, safeExtractMessageAndStackFromError } from "../services/u
import options from "../services/options.js";
import { t } from "i18next";
import ejs from "ejs";
import { join } from "path";
function getSharedSubTreeRoot(note: SNote): { note?: SNote; branch?: SBranch } {
if (note.noteId === shareRoot.SHARE_ROOT_NOTE_ID) {
@@ -401,7 +402,9 @@ function register(router: Router) {
function renderDefault(res: Response<any, Record<string, any>>, template: "page" | "404", opts: any = {}) {
// Path is relative to apps/server/dist/assets/views
const shareThemePath = `../../share-theme/templates/${template}.ejs`;
const shareThemePath = process.env.NODE_ENV === "development"
? join(__dirname, `../../../../packages/share-theme/src/templates/${template}.ejs`)
: `../../share-theme/templates/${template}.ejs`;
res.render(shareThemePath, opts);
}