Skip to content

Commit e4c8568

Browse files
committed
Refactor AddFlagd method to use constant for target port in HTTP endpoint
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
1 parent 940594a commit e4c8568

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/CommunityToolkit.Aspire.Hosting.Flagd/FlagdBuilderExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ namespace Aspire.Hosting;
88
/// </summary>
99
public static class FlagdBuilderExtensions
1010
{
11+
private const int FlagdPort = 8013;
12+
1113
/// <summary>
1214
/// Adds a flagd container to the application model.
1315
/// </summary>
@@ -31,7 +33,7 @@ public static IResourceBuilder<FlagdResource> AddFlagd(
3133
return builder.AddResource(resource)
3234
.WithImage(FlagdContainerImageTags.Image, FlagdContainerImageTags.Tag)
3335
.WithImageRegistry(FlagdContainerImageTags.Registry)
34-
.WithHttpEndpoint(port: port, targetPort: 8013, name: FlagdResource.HttpEndpointName)
36+
.WithHttpEndpoint(port: port, targetPort: FlagdPort, name: FlagdResource.HttpEndpointName)
3537
.WithBindMount(fileSource, "/flags")
3638
.WithArgs("start", "--uri", "file:./flags/flagd.json");
3739
}

0 commit comments

Comments
 (0)