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

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

nelos7
Shopify Partner
7 0 1

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 3 (3)

PeterGeorge
Shopify Partner
44 2 1

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>

 

Please reach me if you want a further assistance for future.
Email: [email protected]

BrainStation23
Shopify Partner
406 60 58

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 (Mail: [email protected])
- Was your question answered? Mark it as an Accepted Solution
- Did the solution not address your concern? We kindly request that share or mail your store URL with us this will enable us to collaborate more closely.
- Explore our Shopify public apps

kumar303
Shopify Staff
1 0 0

How can I get a fixed url tunnel for my shopify app (remix) 


Let's say you want to run your shopify app on port 6000 and you plan on connecting to it by visiting https://my-custom-tunnel.io in a browser. You can configure my-custom-tunnel.io to proxy the local port 6000 using nginx, etc. Here's how to set the shopify app's port:

 

shopify app dev --tunnel-url=https://my-custom-tunnel.io:6000

 

When the shopify command parses this tunnel-url, it will listen on the specified port.