How to get the injected URLs in Aspire service discovery

Discussão em 'Angular' iniciado por wertzui, Dezembro 11, 2024.

  1. wertzui

    wertzui Guest

    I currently have two projects:

    1. API backend
    2. Angular frontend with its own minimal backend.

    The frontend project has 2 purposes:

    1. Serve the angular application
    2. provide one endpoint /settings which the Angular application calls to discover the APIs it can call.

    The data returned by the /settings endpoint is read from one configuration section, which is bound to IOptions<ClientSettings>. The ClientSettings contains a list of APIs with their URLs.

    I want to add Aspire to this solution.

    How can I make sure the URL coming from the Aspire service discovery is returned by my /settings endpoint?

    My guess is that Aspire is injecting environment variables which are then somehow wired up when an HttpClient is being used. However I'm not using an HttpClient here, I just need to change what is returned by the endpoint.

    Continue reading...

Compartilhe esta Página