To change the environment for local development, follow these steps:Why?
When developing a theme, it’s crucial to avoid working directly on theproduction environment
, as it can lead to issues with the live site. Instead, it’s best to use adevelopment environment
for creating and testing new features. This practice ensures that any changes or developments do not affect the live site and helps maintain the stability of the production environment.
.env
file, which contains a variable named STORE_URL
. This variable will have a value like <store-hash>-en-us.experro.app
.
STORE_URL
Variable:
Modify the value of the STORE_URL
variable to switch between different environments. Set it to the appropriate environment URL for your needs.
experro-cli server
:
After updating the STORE_URL
variable, restart the Experro CLI server to apply the changes.
Channel Settings
, you will find the list of languages, as shown in the image below.
STORE_URL
variable, removing https://
from the URL.
Here are examples based on the image:
When pointing to the production
environment for local development, the STORE_URL
would look like this:
development
environment, it would be:
experro-cli server
. This will successfully change the environment for local development.