iway1 / trpc-panel

MIT License
680 stars 54 forks source link

add support for ngrok #52

Open YgorPerez opened 1 year ago

YgorPerez commented 1 year ago

This feature would be super useful because I can't use next auth without a TSL connection and the easiest way to do this in the dev environment in Next.js is with ngrok, it creates a reverse tunnel with the app and makes it available on the internet, so I'm not sure how someone would go about implementing this.

If anyone has any idea on how to do this, but doesn't have the time or put in the effort, point me to what I should do, and I would happily take a shot in implementing it.

iway1 commented 1 year ago

Does something like:

ngrok http 3000

and then updating the url to:

renderTrpcPanel(myTrpcRouter, { url: "https://myngrokdomain.com/api/trpc" });

work?

If that works, then allowing changing the url in the panel after starting it up or something could be one way to make it simpler since the ngrok domain can change

YgorPerez commented 1 year ago
renderTrpcPanel(myTrpcRouter, { url: "https://myngrokdomain.com/api/trpc" });

work?

Thank you for the reply, Yeah, that works!

If that works, then allowing changing the url in the panel after starting it up or something could be one way to make it simpler since the ngrok domain can change

any idea on how to implement that?

khill-fbmc commented 1 year ago

I know this is a little unrelated, but also related. Throwing this out there as an alternative to ngrok