From b7dacf63b0a14316cfe08f84c59b3ef592df2c8b Mon Sep 17 00:00:00 2001 From: pucke-uninow Date: Tue, 4 Jul 2023 20:53:38 +0200 Subject: [PATCH 1/2] fix: add baseUrl to welcome redirect --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 7557c1c6..6ac5a3c8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -57,7 +57,7 @@ registerWelcomeRoute(router) registerErrorRoute(router) router.get("/", (req: Request, res: Response) => { - res.redirect(303, "welcome") + res.redirect(303, `${baseUrl}/welcome`) }) registerStaticRoutes(router) From e8890f5dd39a1d7274290572d13194afe7448135 Mon Sep 17 00:00:00 2001 From: pucke-uninow Date: Tue, 4 Jul 2023 20:54:27 +0200 Subject: [PATCH 2/2] docs: add hint to configure `BASE_PATH` without a trailing slash --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fdedcbac..d5cf3107 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ check whether the session is valid or not. There are two ways of serving this application under a base path: 1. Let Express.js handle the routing by setting the `BASE_PATH` environment - variable to the sub-path, e.g. `/myapp`. + variable to the sub-path, e.g. `/myapp`. (without trailing slash) 2. Use a reverse proxy or API gateway to strip the path prefix. The second approach is not always possible, especially when running the