shuttle-hq / shuttle

Build & ship backends without writing any infrastructure files.
https://shuttle.rs
Apache License 2.0
6.02k stars 251 forks source link

Add resource to get Shuttle service info #562

Closed sd2k closed 1 year ago

sd2k commented 1 year ago

It's not ideal, but there may be some cases where the app will need to know some information about the environment it's running on, most notably the public URL. I'm currently using a custom resource to get the service name and creating a URL out of that, but it might be nice to provide a first-class Resource for the same thing. Happy to send a (more generalized) PR if you think it'd be useful!

oddgrd commented 1 year ago

Hey @sd2k, apologies for the delayed reply. Is this something you're still interested in working on? We've had another request for this now, and your proposed solution seems interesting!

sd2k commented 1 year ago

Hey @oddgrd, yeah I can fire off a PR. I originally wrote it against Shuttle 0.8.0 or something and there's been some big changes to custom resources since then so I'm not 100% confident in it, but that's what reviews are for, right? 😂

oddgrd commented 1 year ago

Great, happy to hear that! 🥳 Yeah, it's changed quite a bit since then, so feel free to open a PR or a draft PR with any questions you may have. It may be useful to look at PRs for other resources that have been added more recently, like the Turso resource.