Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit e23e990

Browse files
added compression to devserver
1 parent 8fc61e9 commit e23e990

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/SqlStreamStore.HAL.DevServer/DevServerStartup.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ public DevServerStartup(IStreamStore streamStore)
2121
_streamStore = streamStore;
2222
}
2323

24-
public IServiceProvider ConfigureServices(IServiceCollection services) => services.BuildServiceProvider();
24+
public IServiceProvider ConfigureServices(IServiceCollection services) => services
25+
.AddResponseCompression(options => options.MimeTypes = new[] { "application/hal+json" })
26+
.BuildServiceProvider();
2527

2628
public void Configure(IApplicationBuilder app) => app
29+
.UseResponseCompression()
2730
.Use(CatchAndDisplayErrors)
2831
.Use(AllowAllOrigins)
2932
.UseSqlStreamStoreHal(_streamStore);
30-
33+
3134
private static MidFunc CatchAndDisplayErrors => async (context, next) =>
3235
{
3336
try
@@ -54,6 +57,5 @@ public void Configure(IApplicationBuilder app) => app
5457

5558
return next();
5659
};
57-
5860
}
5961
}

src/SqlStreamStore.HAL.DevServer/SqlStreamStore.HAL.DevServer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.0.2" />
99
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.2" />
10+
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.0.2" />
1011
</ItemGroup>
1112
<ItemGroup>
1213
<ProjectReference Include="..\SqlStreamStore.HAL\SqlStreamStore.HAL.csproj" />

0 commit comments

Comments
 (0)