Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve listen command #69

Open
driesvints opened this issue Dec 13, 2023 · 5 comments
Open

Improve listen command #69

driesvints opened this issue Dec 13, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@driesvints
Copy link
Contributor

It would be cool if we could somehow get the event name and ID in the output of the listen command in similar fashion as the stripe listen command. I'm not sure if that's possible though because Expose controls the output here. cc @mpociot @DanielHudson

Screenshot 2023-12-13 at 09 33 54
@driesvints driesvints added the enhancement New feature or request label Dec 13, 2023
@DanielHudson
Copy link
Contributor

Yes, currently the output from both expose and ngrok are not looking great.

The only way I can think to do this for both services is to log incoming webhooks via WebhookHandled, and then have the command do some kinda of tail -f equivalent in the "process" loop.

Downside is you'd probably need to always save the webhook logs either when not in production, or when LOG_LEVEL=debug, unless a specific config is added.

Happy to have a look at this if it sounds useful.

@mpociot
Copy link

mpociot commented Dec 21, 2023

So the way I want to approach this with Expose is to have some kind of payload specific output.

We would have an array of "drivers" that detect which URL the request is coming from. If it's from a URL that is registered, we would parse the payload and the driver can then take care of rendering the CLI output. This way this could be added to Expose for all sorts of providers.

@driesvints
Copy link
Contributor Author

@mpociot that would be fantastic really.

@DanielHudson
Copy link
Contributor

Happy to take a look at the alternative solution when I get a sec if it helps, my suggestion should also work for ngrok too...

We could switch to @mpociot suggestion later if the feature becomes available. (Maybe it already is?)

@heyjorgedev
Copy link
Contributor

@DanielHudson can we also create a file somewhere when the listen command gets executed, tail it like you suggested and on the WebhookHandled check for the existence of such file and write to it? after the command exits delete the file like you delete the webhooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants