cli icon indicating copy to clipboard operation
cli copied to clipboard

Ability to access production API base URL as environment variable

Open davemooreuws opened this issue 2 years ago • 2 comments

Describe the solution you'd like Ability to access the base URL of the API so it can be used in code without having to set it after deployment.

Why is this needed? What challenge will it help you solve? Please describe. It would also be useful to set a base url environment variable for deployments, so we can reference it in application code without needing to set it.

davemooreuws avatar Mar 18 '22 05:03 davemooreuws

see https://github.com/nitrictech/cli/issues/187#issuecomment-1072048868

asalkeld avatar Mar 18 '22 05:03 asalkeld

This is an interesting one as there is a cyclic dependency for deployment. As in you need to deploy the functions to wire up the gateway, but then you can only deploy the functions if the gateway is already deployed?

Are there other methods we could recommend here, like using headers? e.g. Host (This also applies if you have a single function connected to two different gateways).

tjholm avatar Apr 28 '22 00:04 tjholm

Gateway urls can now be accessed at runtime using the Details API for resources.

tjholm avatar Mar 16 '23 00:03 tjholm