mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
chore(server): serve ck-content for share
This commit is contained in:
@@ -5,6 +5,7 @@ import express from "express";
|
||||
import { getResourceDir, isDev } from "../services/utils.js";
|
||||
import type serveStatic from "serve-static";
|
||||
import proxy from "express-http-proxy";
|
||||
import contentCss from "@triliumnext/ckeditor5/content.css";
|
||||
|
||||
const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOptions<express.Response<unknown, Record<string, unknown>>>) => {
|
||||
if (!isDev) {
|
||||
@@ -20,6 +21,8 @@ async function register(app: express.Application) {
|
||||
const srcRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const resourceDir = getResourceDir();
|
||||
|
||||
app.use(`/${assetPath}/libraries/ckeditor/ckeditor-content.css`, (req, res) => res.contentType("text/css").send(contentCss));
|
||||
|
||||
if (isDev) {
|
||||
const publicUrl = process.env.TRILIUM_PUBLIC_SERVER;
|
||||
if (!publicUrl) {
|
||||
|
||||
5
apps/server/src/types.d.ts
vendored
5
apps/server/src/types.d.ts
vendored
@@ -22,3 +22,8 @@ declare module "is-animated" {
|
||||
function isAnimated(buffer: Buffer): boolean;
|
||||
export default isAnimated;
|
||||
}
|
||||
|
||||
declare module "@triliumnext/ckeditor5/content.css" {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user