Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ When the resource is started, the URL is available in the dashboard.

Alternatively, you could use the overload that accepts a `Func<EndpointReference, ResourceUrlAnnotation>` as a callback. This allows you to specify deep-links on target `EndpointReference` instances.

### Control URL display order

When a resource exposes multiple custom URLs, use the `DisplayOrder` property on `ResourceUrlAnnotation` to control the order they appear in the dashboard. Higher values sort higher (first) in the list. `DisplayOrder` is a nullable `int`, so URLs without an explicit value fall back to the default ordering.

```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);

builder.AddProject<Projects.AspireApp_Api>("api")
.WithUrlForEndpoint("https", url =>
{
url.DisplayText = "Scalar (HTTPS)";
url.Url = "/scalar";
url.DisplayOrder = 1000;
});

builder.Build().Run();
```

### Customize multiple resource URLs

To customize multiple URLs for a resource, use the `WithUrls` method. This method allows you to specify multiple URLs for a resource, each with its own display text. The following example demonstrates how to set multiple URLs for a project resource:
Expand Down
Loading