|
|
|
@ -19,9 +19,10 @@ const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOp
|
|
|
|
async function register(app: express.Application) {
|
|
|
|
async function register(app: express.Application) {
|
|
|
|
const srcRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
|
|
const srcRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
|
|
if (isDev) {
|
|
|
|
if (isDev) {
|
|
|
|
|
|
|
|
const clientProxy = proxy(process.env.TRILIUM_PUBLIC_SERVER);
|
|
|
|
app.use(`/${assetPath}/app/doc_notes`, persistentCacheStatic(path.join(srcRoot, "public/app/doc_notes")));
|
|
|
|
app.use(`/${assetPath}/app/doc_notes`, persistentCacheStatic(path.join(srcRoot, "public/app/doc_notes")));
|
|
|
|
app.use(`/${assetPath}/app`, proxy("localhost:4200"));
|
|
|
|
app.use(`/${assetPath}/app`, clientProxy);
|
|
|
|
app.use(`/${assetPath}/app-dist`, proxy("localhost:4200"));
|
|
|
|
app.use(`/${assetPath}/app-dist`, clientProxy);
|
|
|
|
app.use(`/${assetPath}/stylesheets`, persistentCacheStatic(path.join(srcRoot, "../../client/stylesheets")));
|
|
|
|
app.use(`/${assetPath}/stylesheets`, persistentCacheStatic(path.join(srcRoot, "../../client/stylesheets")));
|
|
|
|
app.use(`/${assetPath}/libraries`, persistentCacheStatic(path.join(srcRoot, "../../client/libraries")));
|
|
|
|
app.use(`/${assetPath}/libraries`, persistentCacheStatic(path.join(srcRoot, "../../client/libraries")));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|