Skip to content

Commit 91305ae

Browse files
Copilotdavidfowl
andcommitted
Remove automatic WithExternalHttpEndpoints from AddViteApp to let users decide
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
1 parent ef4e6e9 commit 91305ae

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/CommunityToolkit.Aspire.Hosting.NodeJS.Extensions/NodeJSHostingExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public static IResourceBuilder<NodeAppResource> AddViteApp(this IDistributedAppl
3838
};
3939

4040
_ = useHttps
41-
? resource.WithHttpsEndpoint(env: "PORT").WithExternalHttpEndpoints()
42-
: resource.WithHttpEndpoint(env: "PORT").WithExternalHttpEndpoints();
41+
? resource.WithHttpsEndpoint(env: "PORT")
42+
: resource.WithHttpEndpoint(env: "PORT");
4343

4444
return resource.WithArgs(ctx =>
4545
{

tests/CommunityToolkit.Aspire.Hosting.NodeJS.Extensions.Tests/ResourceCreationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public void ViteAppHasExposedHttpsEndpoints()
139139

140140

141141
[Fact]
142-
public void ViteAppHasExposedExternalHttpEndpoints()
142+
public void ViteAppDoesNotExposeExternalHttpEndpointsByDefault()
143143
{
144144
var builder = DistributedApplication.CreateBuilder();
145145

@@ -155,7 +155,7 @@ public void ViteAppHasExposedExternalHttpEndpoints()
155155

156156
Assert.True(resource.TryGetAnnotationsOfType<EndpointAnnotation>(out var endpoints));
157157

158-
Assert.Contains(endpoints, e => e.IsExternal);
158+
Assert.DoesNotContain(endpoints, e => e.IsExternal);
159159
}
160160

161161
[Fact]

0 commit comments

Comments
 (0)