Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Add readme sample for web root path variable #331

Merged
merged 1 commit into from
May 18, 2021
Merged

Conversation

feedmeapples
Copy link
Contributor

@feedmeapples feedmeapples commented May 18, 2021

What was changed

Adds readme sample of TEMPORAL_WEB_ROOT_PATH value

Why?

Web root path works only if passed in a format with forward slashes on both sides. This value is passed to koa-router, webpack and used in http.js.

Another option would be to do custom processing and modify the value so it fits the format.
The below regex can be used to trim forward slashes on both ends of the path. Then the resulting value can be passed to koa-router, webpack and http.js according to their expected format (adding forward slashes if needed). Having slashes on both sides works for all places

"/test/root/path/".replace(/(^\/|\/$)/, '')

Checklist

  1. Closes issue:

  2. How was this tested:

Ran with TEMPORAL_WEB_ROOT_PATH set to "/test/"

  1. Any docs updates needed?

No

@feedmeapples feedmeapples requested a review from swyxio May 18, 2021 04:10
@swyxio
Copy link
Contributor

swyxio commented May 18, 2021

examples always a good idea!

@swyxio swyxio merged commit 37f6d54 into master May 18, 2021
@swyxio swyxio deleted the root-path-example-value branch May 18, 2021 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants