-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support configuring WP_HOME
with alternate port
#26481
Comments
@joemcgill I'm not super familiar with how these settings are often used. I coded them to be the same because I had some trouble when they were different :) Is there a reason why using the same port for each of these URLs won't work? What kind of use case would this enable, out of curiosity? |
Hi @noahtallen, like I described in the issue description, I'm wanting to use wp-env run the backend for a headless site where |
I put together a PR that I think takes care of this, but I may be missing something so would appreciate feedback! |
Interesting use case! Thanks for clarifying, I appreciate understanding that better. I'll take a look at your PR now :) |
This checks for whether a custom port has been set for `WP_HOME` in the .wp-env.json file before appending the environment's to support local environments where the front end needs to be pointed at another port (e.g., a headless app). Adds unit test. Resolves WordPress#26481
This checks for whether a custom port has been set for `WP_HOME` in the .wp-env.json file before appending the environment's to support local environments where the front end needs to be pointed at another port (e.g., a headless app). Resolves #26481
Is your feature request related to a problem? Please describe.
I want to use
@wordpress/env
to create an environment to test a headless WordPress application where the front end will be run from a node application running outside of the Env's docker setup. To do this, I want to be able to specify aWP_HOME
likehttp://localhost:3001
in my.wp-env.json
file and have the port specified be respected.However, right now the
withOverrides()
function in config/config.js overrides the port with the port of the environment specified.Describe the solution you'd like
I'd like to see
withOverrides()
check to see if a port value is set forWP_HOME
before overriding it here: https://github.com/WordPress/gutenberg/blob/master/packages/env/lib/config/config.js#L262 I think overriding theWP_TESTS_DOMAIN
andWP_SITEURL
probably makes sense to leave as is.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
The text was updated successfully, but these errors were encountered: