This repository was archived by the owner on Sep 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
src/SqlStreamStore.HAL.DevServer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 internal class DevServerStartup : IStartup
1717 {
1818 private readonly IStreamStore _streamStore ;
19+ private readonly SqlStreamStoreMiddlewareOptions _options ;
1920
20- public DevServerStartup ( IStreamStore streamStore )
21+ public DevServerStartup (
22+ IStreamStore streamStore ,
23+ SqlStreamStoreMiddlewareOptions options )
2124 {
2225 _streamStore = streamStore ;
26+ _options = options ;
2327 }
2428
2529 public IServiceProvider ConfigureServices ( IServiceCollection services ) => services
@@ -31,7 +35,7 @@ public void Configure(IApplicationBuilder app) => app
3135 . Use ( VaryAccept )
3236 . Use ( CatchAndDisplayErrors )
3337 . UseSqlStreamStoreBrowser ( )
34- . UseSqlStreamStoreHal ( _streamStore ) ;
38+ . UseSqlStreamStoreHal ( _streamStore , _options ) ;
3539
3640 private static MidFunc CatchAndDisplayErrors => async ( context , next ) =>
3741 {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ internal class Program : IDisposable
1616 private readonly IConfigurationRoot _configuration ;
1717
1818 private bool Interactive => _configuration . GetValue < bool > ( "interactive" ) ;
19+ private bool UseCanonicalUrls => _configuration . GetValue < bool > ( "canonical" ) ;
1920
2021 public static async Task < int > Main ( string [ ] args )
2122 {
@@ -47,7 +48,10 @@ private async Task<int> Run()
4748 using ( var streamStore = await SqlStreamStoreFactory . Create ( ) )
4849 using ( var host = new WebHostBuilder ( )
4950 . UseKestrel ( )
50- . UseStartup ( new DevServerStartup ( streamStore ) )
51+ . UseStartup ( new DevServerStartup ( streamStore , new SqlStreamStoreMiddlewareOptions
52+ {
53+ UseCanonicalUrls = UseCanonicalUrls
54+ } ) )
5155 . UseSerilog ( )
5256 . Build ( ) )
5357 {
You can’t perform that action at this time.
0 commit comments