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 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)