diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7783d5d..b8dbdd6 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,12 @@ Release Notes ============= +## 0.14.0 + +#### New features + +- Added the ASP.NET Core default developer exception page when environment is development. + ## 0.13.0 #### New features diff --git a/src/content/DotLiquid/src/AppNamePlaceholder/Program.fs b/src/content/DotLiquid/src/AppNamePlaceholder/Program.fs index ff43b85..dd33ccb 100644 --- a/src/content/DotLiquid/src/AppNamePlaceholder/Program.fs +++ b/src/content/DotLiquid/src/AppNamePlaceholder/Program.fs @@ -48,10 +48,13 @@ let configureCors (builder : CorsPolicyBuilder) = |> ignore let configureApp (app : IApplicationBuilder) = - app.UseCors(configureCors) - .UseGiraffeErrorHandler(errorHandler) - .UseStaticFiles() - .UseGiraffe(webApp) + let env = app.ApplicationServices.GetService() + (match env.IsDevelopment() with + | true -> app.UseDeveloperExceptionPage() + | false -> app.UseGiraffeErrorHandler errorHandler) + .UseCors(configureCors) + .UseStaticFiles() + .UseGiraffe(webApp) let configureServices (services : IServiceCollection) = services.AddCors() |> ignore diff --git a/src/content/Giraffe/src/AppNamePlaceholder/Program.fs b/src/content/Giraffe/src/AppNamePlaceholder/Program.fs index 0877004..13aad04 100644 --- a/src/content/Giraffe/src/AppNamePlaceholder/Program.fs +++ b/src/content/Giraffe/src/AppNamePlaceholder/Program.fs @@ -81,10 +81,13 @@ let configureCors (builder : CorsPolicyBuilder) = |> ignore let configureApp (app : IApplicationBuilder) = - app.UseCors(configureCors) - .UseGiraffeErrorHandler(errorHandler) - .UseStaticFiles() - .UseGiraffe(webApp) + let env = app.ApplicationServices.GetService() + (match env.IsDevelopment() with + | true -> app.UseDeveloperExceptionPage() + | false -> app.UseGiraffeErrorHandler errorHandler) + .UseCors(configureCors) + .UseStaticFiles() + .UseGiraffe(webApp) let configureServices (services : IServiceCollection) = services.AddCors() |> ignore diff --git a/src/content/None/src/AppNamePlaceholder/Program.fs b/src/content/None/src/AppNamePlaceholder/Program.fs index c8d7023..a681bfd 100644 --- a/src/content/None/src/AppNamePlaceholder/Program.fs +++ b/src/content/None/src/AppNamePlaceholder/Program.fs @@ -42,9 +42,12 @@ let configureCors (builder : CorsPolicyBuilder) = |> ignore let configureApp (app : IApplicationBuilder) = - app.UseCors(configureCors) - .UseGiraffeErrorHandler(errorHandler) - .UseGiraffe(webApp) + let env = app.ApplicationServices.GetService() + (match env.IsDevelopment() with + | true -> app.UseDeveloperExceptionPage() + | false -> app.UseGiraffeErrorHandler errorHandler) + .UseCors(configureCors) + .UseGiraffe(webApp) let configureServices (services : IServiceCollection) = let sp = services.BuildServiceProvider() diff --git a/src/content/Razor/src/AppNamePlaceholder/Program.fs b/src/content/Razor/src/AppNamePlaceholder/Program.fs index 025cb46..b1c0ea2 100644 --- a/src/content/Razor/src/AppNamePlaceholder/Program.fs +++ b/src/content/Razor/src/AppNamePlaceholder/Program.fs @@ -48,10 +48,13 @@ let configureCors (builder : CorsPolicyBuilder) = |> ignore let configureApp (app : IApplicationBuilder) = - app.UseCors(configureCors) - .UseGiraffeErrorHandler(errorHandler) - .UseStaticFiles() - .UseGiraffe(webApp) + let env = app.ApplicationServices.GetService() + (match env.IsDevelopment() with + | true -> app.UseDeveloperExceptionPage() + | false -> app.UseGiraffeErrorHandler errorHandler) + .UseCors(configureCors) + .UseStaticFiles() + .UseGiraffe(webApp) let configureServices (services : IServiceCollection) = let sp = services.BuildServiceProvider() diff --git a/src/giraffe-template.nuspec b/src/giraffe-template.nuspec index 762cc02..51d5d33 100644 --- a/src/giraffe-template.nuspec +++ b/src/giraffe-template.nuspec @@ -2,7 +2,7 @@ giraffe-template - 0.13.0 + 0.14.0 Giraffe Template for dotnet-new A dotnet-new template for Giraffe web applications. A dotnet-new template for Giraffe web applications.