Using the new .NET Aspire Let's explore a scenario involving two web apps: the main app, and the login app:
var login = builder.AddProject<Projects.LoginApp_Web>("login");
builder.AddProject<Projects.AspireApp_Web>("main-app")
.WithReference(login); // not sure if will be need it
Questions:
- Main App Endpoint to Login App: In the main-app, specifically on a Razor page, how can we create an endpoint that directs users to the login app?
- Furthermore, Two-Way Navigation, Is it possible to establish a two-way link between the main app and the login app? For instance, can the main app provide a link to the login app, and vice versa, How would we achieve this?
It seems the ServiceDiscovery is the responsible for that, but I am not able to figure it out how to use it.
Thank you @AkalankaDissanayake,
.WithReference(login);instead need to gethttporhttpsurl and save it in app Environment.Original code: