How to change URL of PWA in Magento 2.3?
-
13-02-2021 - |
質問
I have installed the PWA studio successfully with the Venia storefront. But my development environment URL is generating something like below.
How I can change the URL to something else.
解決
You can change the PWA development environment domain names by updating below env variables inside below path.
/var/www/pwa-studio/packages/venia-concept/.env:37
And uncomment below lines and give your domain names.
# By default your subdomain will be detected from your package.json name.
# Use this to override it.
# MAGENTO_BUILDPACK_SECURE_HOST_SUBDOMAIN='custom-value'
# This will prepend the uniquely generated domain with `custom-value`.
#
# By default your custom host will be a subdomain of `local.pwadev`.
# Use this to specify an entire domain, avoiding that TLD.
# MAGENTO_BUILDPACK_SECURE_HOST_EXACT_DOMAIN='my-favorite.pizza'
Then rebuild using below commands and watch the Venia storefront on the new domain name.
npm run build
npm run watch:venia
他のヒント
@sakshi
You need to do following things to resolve the url issues:
- check the environment file nano packages/venia-concept/.env
- change
MAGENTO_BACKEND_URL=http://yourdomain/
in your case it should beMAGENTO_BACKEND_URL=https://health365.local/
- change CUSTOM_ORIGIN_EXACT_DOMAIN=health365.local
- your 10000 port should open (very important) , you need to add it in .env file
DEV_SERVER_PORT=10000
, save the .env file. - run this command to generate ssl cert for venia package
yarn buildpack create-custom-origin packages/venia-concept
yarn run watch:venia
enjoy !!
所属していません magento.stackexchange