How can I set a fixed URL tunnel for a Shopify app with random port?

nelos7
Shopify Partner
7 0 0

Hi,

How can I get a fixed url tunnel for my shopify app (remix) for webhook, since we can't set a fixed port for the app.
Normally i would do it like this : "ngrok http PORT" but the port for the remix app is set randomly at each start

Replies 2 (2)

Peter1983
Shopify Partner
17 0 0

You could update the url and uses static url thru .toml config file.
[build]
automatically_update_urls_on_dev = true
Or

sudo npm run dev -- --tunnel-url https://<tunnel url>:<port>

 

BrainStation23
Shopify Partner
305 50 49

hi @nelos7 

You can manually set the tunnel url using the --tunnel-url flag while running a Shopify app using the CLI. 
the command should look like this

 

shopify app dev --tunnel-url <tunnel-url>:<PORT> 

 

or if you're using the Shopify cli via npm then

 

npm run dev -- --tunnel-url <tunnel-url>:<PORT>

 

here the port is the port which is the port forwarding tool is listening to. (the you gave while running ngrok HTTP <PORT>)

Brain Station 23 PLC
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Email: js.team@brainstation-23.com