From ca1c0b459ce1132c118fa461b325ff0a6d6b8953 Mon Sep 17 00:00:00 2001 From: jojozhuang Date: Wed, 24 Jan 2024 14:45:51 -0800 Subject: [PATCH 1/3] disable static serve --- src/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.ts b/src/app.ts index bfd15ca..963a7f0 100644 --- a/src/app.ts +++ b/src/app.ts @@ -66,9 +66,9 @@ class App { // Use the root routes when path starts with /api this.app.use('/api', routers); // serve static files - this.app.use('/static', express.static(config.rootDir)); + //this.app.use('/static', express.static(config.rootDir)); // serve angular app(compiled static files) - this.app.use(express.static(config.webDir)); + //this.app.use(express.static(config.webDir)); // fix 404 error after refresh page built with angular, // see https://stackoverflow.com/questions/54715105/getting-404-page-on-page-refresh-using-node-and-angular-ap From 542bcfb1904ec700e4559d4f6f267c0bdbe59145 Mon Sep 17 00:00:00 2001 From: jojozhuang Date: Wed, 24 Jan 2024 15:07:44 -0800 Subject: [PATCH 2/3] enable edit mode --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 605545c..0339d9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ COPY ./src ./src ENV PORT=80 \ ROOT_DIR='/app/root' \ WEB_ROOT='/app/web' \ - EDIT_MODE='false' + EDIT_MODE='true' RUN npm ci --quiet && npm run build-prod From bee94b20a2ae158736ed37bcc50a85ca9a884c1e Mon Sep 17 00:00:00 2001 From: jojozhuang Date: Wed, 24 Jan 2024 15:16:13 -0800 Subject: [PATCH 3/3] enable static --- src/app.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.ts b/src/app.ts index 963a7f0..bfd15ca 100644 --- a/src/app.ts +++ b/src/app.ts @@ -66,9 +66,9 @@ class App { // Use the root routes when path starts with /api this.app.use('/api', routers); // serve static files - //this.app.use('/static', express.static(config.rootDir)); + this.app.use('/static', express.static(config.rootDir)); // serve angular app(compiled static files) - //this.app.use(express.static(config.webDir)); + this.app.use(express.static(config.webDir)); // fix 404 error after refresh page built with angular, // see https://stackoverflow.com/questions/54715105/getting-404-page-on-page-refresh-using-node-and-angular-ap