twilio-labs / serverless-toolkit

CLI tool to develop, debug and deploy Twilio Functions
https://www.twilio.com/docs/labs/serverless-toolkit
MIT License
109 stars 57 forks source link

Allow ngrok configuration to be passed in #158

Open dsmwong opened 3 years ago

dsmwong commented 3 years ago

Hi,

It would be good to be able to add additional options to allow ngrok configuration to be passed in. The following use cases for --ngrok action

  1. pass in subdomain into ngrok so it generate a consistent URI for ngrok
  2. pass in user specified configuration file instead of using ~/.ngrok2/ngrok.yml for configration. This will allow project specific ngrok configuration to be set.
welcome[bot] commented 3 years ago

Thank you so much for opening your first issue in this project! We'll try to get back to it as quickly as possible. While you are waiting...here's a random picture of a corgi (powered by dog.ceo)

picture of dog

dsmwong commented 3 years ago

Apologies - wrong project. moving to serverless plugin.

philnash commented 3 years ago

Actually I think this is where most of the implementation would go. @twilio-labs/plugin-serverless#38 will be needed so that the Serverless Plugin gets the options added.

philnash commented 3 years ago

Hey @dsmwong, just took a look at this. Two bits of good news:

  1. You can already pass in a subdomain to the ngrok command, there's no separate option, you just pass it with --ngrok like so:
    $ twilio serverless:start --ngrok=subdomain
    or
    $ npx twilio-run --ngrok=subdomain
  2. I've just opened a PR to implement custom config and named tunnels. I'd appreciate feedback on that, if you have time.