mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
refactor(nx/client): set up proxy to client
This commit is contained in:
parent
5308a089b8
commit
659ccd8561
@ -1,2 +1,3 @@
|
||||
TRILIUM_ENV=dev
|
||||
TRILIUM_DATA_DIR=./apps/server/data
|
||||
TRILIUM_DATA_DIR=./apps/server/data
|
||||
TRILIUM_PUBLIC_SERVER=http://localhost:4200
|
@ -19,9 +19,10 @@ const persistentCacheStatic = (root: string, options?: serveStatic.ServeStaticOp
|
||||
async function register(app: express.Application) {
|
||||
const srcRoot = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
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`, proxy("localhost:4200"));
|
||||
app.use(`/${assetPath}/app-dist`, proxy("localhost:4200"));
|
||||
app.use(`/${assetPath}/app`, clientProxy);
|
||||
app.use(`/${assetPath}/app-dist`, clientProxy);
|
||||
app.use(`/${assetPath}/stylesheets`, persistentCacheStatic(path.join(srcRoot, "../../client/stylesheets")));
|
||||
app.use(`/${assetPath}/libraries`, persistentCacheStatic(path.join(srcRoot, "../../client/libraries")));
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user