We have a scenario where we have a frontend browser based application which calls a Backend API. The backend API needs to be configured with CORS rules for which frontend clients are able to call this API, which is driven from environment variables. So we need to know what the public URLs are that requests will be coming in from.
When using the dev.localhost "vanity" hostname system in Aspire, the actual hostname you will be accessing the frontend via is resourceName-appname.dev.localhost:XXXX, however it does not appear that we have a way to get this endpoint from a resource to pass this through.
resource.GetEndpoint("https", KnownNetworkIdentifiers.LocalhostNetwork); <- this will return localhost:XXXX. There doesn't seem to be a means of getting the *.dev.localhost:XXXX hostname that is presented in the Aspire dashboard.
We have a scenario where we have a frontend browser based application which calls a Backend API. The backend API needs to be configured with CORS rules for which frontend clients are able to call this API, which is driven from environment variables. So we need to know what the public URLs are that requests will be coming in from.
When using the
dev.localhost"vanity" hostname system in Aspire, the actual hostname you will be accessing the frontend via isresourceName-appname.dev.localhost:XXXX, however it does not appear that we have a way to get this endpoint from a resource to pass this through.resource.GetEndpoint("https", KnownNetworkIdentifiers.LocalhostNetwork);<- this will returnlocalhost:XXXX. There doesn't seem to be a means of getting the*.dev.localhost:XXXXhostname that is presented in the Aspire dashboard.