Content Deep Dive
Integrate ngrok into ASP.NET Core startup and automatically update your webhook URLs
Blog post from Twilio
Post Details
Company
Date Published
Author
Niels Swimberghe
Word Count
3,281
Language
English
Hacker News Points
-
Summary
Integrating ngrok into ASP.NET Core startup automates the process of updating webhook URLs, making it easier to develop webhooks locally. The `TunnelService` class uses the `CliWrap` library to run the ngrok CLI and fetches the public URL from ngrok's local API. It then updates Twilio webhooks using this public URL. To use this service in a development environment, configure the project to run it as a hosted service. Once running, the application will automatically start an ngrok tunnel and update Twilio webhooks with the new URL. The updated webhooks can be tested by calling or texting the Twilio phone number associated with the webhook.