diff --git a/README.md b/README.md index 4c57244..82b2238 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Whenever there is a new version of the Giraffe template you can update it by re- You can also explicitly set the version when installing the template: ``` -dotnet new -i "giraffe-template::1.0.0" +dotnet new -i "giraffe-template::1.3.0" ``` ## Basics diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index af26208..0d273ec 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,13 @@ Release Notes ============= +## 1.3.0 + +- Removed log filter +- Improved default CORS policy +- HTTPS redirection not during Development +- Updated to Giraffe 5.0.0-rc-6 with Ply + ## 1.2.0 - Updated all templates to .NET 5 and Giraffe 5.0.0-rc-1 diff --git a/src/content/DotLiquid/paket.dependencies b/src/content/DotLiquid/paket.dependencies index 1967cc3..0792445 100644 --- a/src/content/DotLiquid/paket.dependencies +++ b/src/content/DotLiquid/paket.dependencies @@ -2,9 +2,9 @@ storage: none framework: auto-detect source https://api.nuget.org/v3/index.json -nuget Giraffe ~> 5.0.0-rc-1 +nuget Giraffe ~> 5.0.0-rc-6 nuget Giraffe.DotLiquid -nuget TaskBuilder.fs +nuget Ply nuget Microsoft.NET.Test.Sdk nuget Microsoft.AspNetCore.TestHost nuget xunit diff --git a/src/content/DotLiquid/src/AppName.1/AppName.1.fsproj b/src/content/DotLiquid/src/AppName.1/AppName.1.fsproj index 4e2e156..9c0fccf 100644 --- a/src/content/DotLiquid/src/AppName.1/AppName.1.fsproj +++ b/src/content/DotLiquid/src/AppName.1/AppName.1.fsproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/src/content/DotLiquid/src/AppName.1/Program.fs b/src/content/DotLiquid/src/AppName.1/Program.fs index 204f01e..712c948 100644 --- a/src/content/DotLiquid/src/AppName.1/Program.fs +++ b/src/content/DotLiquid/src/AppName.1/Program.fs @@ -43,17 +43,22 @@ let errorHandler (ex : Exception) (logger : ILogger) = // --------------------------------- let configureCors (builder : CorsPolicyBuilder) = - builder.WithOrigins("http://localhost:8080") - .AllowAnyMethod() - .AllowAnyHeader() - |> ignore + builder + .WithOrigins( + "http://localhost:5000", + "https://localhost:5001") + .AllowAnyMethod() + .AllowAnyHeader() + |> ignore let configureApp (app : IApplicationBuilder) = let env = app.ApplicationServices.GetService() - (match env.EnvironmentName with - | "Development" -> app.UseDeveloperExceptionPage() - | _ -> app.UseGiraffeErrorHandler(errorHandler)) - .UseHttpsRedirection() + (match env.IsDevelopment() with + | true -> + app.UseDeveloperExceptionPage() + | false -> + app .UseGiraffeErrorHandler(errorHandler) + .UseHttpsRedirection()) .UseCors(configureCors) .UseStaticFiles() .UseGiraffe(webApp) @@ -63,8 +68,7 @@ let configureServices (services : IServiceCollection) = services.AddGiraffe() |> ignore let configureLogging (builder : ILoggingBuilder) = - builder.AddFilter(fun l -> l.Equals LogLevel.Error) - .AddConsole() + builder.AddConsole() .AddDebug() |> ignore [] diff --git a/src/content/DotLiquid/src/AppName.1/paket.references b/src/content/DotLiquid/src/AppName.1/paket.references index 84e4684..b426c46 100644 --- a/src/content/DotLiquid/src/AppName.1/paket.references +++ b/src/content/DotLiquid/src/AppName.1/paket.references @@ -1,3 +1,3 @@ Giraffe Giraffe.DotLiquid -TaskBuilder.fs \ No newline at end of file +Ply \ No newline at end of file diff --git a/src/content/Giraffe/src/AppName.1/AppName.1.fsproj b/src/content/Giraffe/src/AppName.1/AppName.1.fsproj index 5c642f7..3e15875 100644 --- a/src/content/Giraffe/src/AppName.1/AppName.1.fsproj +++ b/src/content/Giraffe/src/AppName.1/AppName.1.fsproj @@ -7,9 +7,9 @@ - + - + diff --git a/src/content/Giraffe/src/AppName.1/Program.fs b/src/content/Giraffe/src/AppName.1/Program.fs index 426cc7c..fe8d4d8 100644 --- a/src/content/Giraffe/src/AppName.1/Program.fs +++ b/src/content/Giraffe/src/AppName.1/Program.fs @@ -78,17 +78,22 @@ let errorHandler (ex : Exception) (logger : ILogger) = // --------------------------------- let configureCors (builder : CorsPolicyBuilder) = - builder.WithOrigins("http://localhost:8080") - .AllowAnyMethod() - .AllowAnyHeader() - |> ignore + builder + .WithOrigins( + "http://localhost:5000", + "https://localhost:5001") + .AllowAnyMethod() + .AllowAnyHeader() + |> ignore let configureApp (app : IApplicationBuilder) = let env = app.ApplicationServices.GetService() - (match env.EnvironmentName with - | "Development" -> app.UseDeveloperExceptionPage() - | _ -> app.UseGiraffeErrorHandler(errorHandler)) - .UseHttpsRedirection() + (match env.IsDevelopment() with + | true -> + app.UseDeveloperExceptionPage() + | false -> + app .UseGiraffeErrorHandler(errorHandler) + .UseHttpsRedirection()) .UseCors(configureCors) .UseStaticFiles() .UseGiraffe(webApp) @@ -98,8 +103,7 @@ let configureServices (services : IServiceCollection) = services.AddGiraffe() |> ignore let configureLogging (builder : ILoggingBuilder) = - builder.AddFilter(fun l -> l.Equals LogLevel.Error) - .AddConsole() + builder.AddConsole() .AddDebug() |> ignore [] diff --git a/src/content/None/src/AppName.1/AppName.1.fsproj b/src/content/None/src/AppName.1/AppName.1.fsproj index 67be71a..8942df4 100644 --- a/src/content/None/src/AppName.1/AppName.1.fsproj +++ b/src/content/None/src/AppName.1/AppName.1.fsproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/content/None/src/AppName.1/HttpHandlers.fs b/src/content/None/src/AppName.1/HttpHandlers.fs index 245346d..6906b61 100644 --- a/src/content/None/src/AppName.1/HttpHandlers.fs +++ b/src/content/None/src/AppName.1/HttpHandlers.fs @@ -3,7 +3,7 @@ namespace AppName._1 module HttpHandlers = open Microsoft.AspNetCore.Http - open FSharp.Control.Tasks.V2.ContextInsensitive + open FSharp.Control.Tasks open Giraffe open AppName._1.Models diff --git a/src/content/None/src/AppName.1/Program.fs b/src/content/None/src/AppName.1/Program.fs index da38722..e614b0a 100644 --- a/src/content/None/src/AppName.1/Program.fs +++ b/src/content/None/src/AppName.1/Program.fs @@ -37,17 +37,22 @@ let errorHandler (ex : Exception) (logger : ILogger) = // --------------------------------- let configureCors (builder : CorsPolicyBuilder) = - builder.WithOrigins("http://localhost:8080") - .AllowAnyMethod() - .AllowAnyHeader() - |> ignore + builder + .WithOrigins( + "http://localhost:5000", + "https://localhost:5001") + .AllowAnyMethod() + .AllowAnyHeader() + |> ignore let configureApp (app : IApplicationBuilder) = let env = app.ApplicationServices.GetService() - (match env.EnvironmentName with - | "Development" -> app.UseDeveloperExceptionPage() - | _ -> app.UseGiraffeErrorHandler(errorHandler)) - .UseHttpsRedirection() + (match env.IsDevelopment() with + | true -> + app.UseDeveloperExceptionPage() + | false -> + app .UseGiraffeErrorHandler(errorHandler) + .UseHttpsRedirection()) .UseCors(configureCors) .UseGiraffe(webApp) @@ -56,8 +61,7 @@ let configureServices (services : IServiceCollection) = services.AddGiraffe() |> ignore let configureLogging (builder : ILoggingBuilder) = - builder.AddFilter(fun l -> l.Equals LogLevel.Error) - .AddConsole() + builder.AddConsole() .AddDebug() |> ignore [] diff --git a/src/content/Razor/src/AppName.1/AppName.1.fsproj b/src/content/Razor/src/AppName.1/AppName.1.fsproj index d8cb67d..d6e9e76 100644 --- a/src/content/Razor/src/AppName.1/AppName.1.fsproj +++ b/src/content/Razor/src/AppName.1/AppName.1.fsproj @@ -7,11 +7,10 @@ - - - - - + + + + diff --git a/src/content/Razor/src/AppName.1/Program.fs b/src/content/Razor/src/AppName.1/Program.fs index 886e7a5..67e24c9 100644 --- a/src/content/Razor/src/AppName.1/Program.fs +++ b/src/content/Razor/src/AppName.1/Program.fs @@ -43,17 +43,22 @@ let errorHandler (ex : Exception) (logger : ILogger) = // --------------------------------- let configureCors (builder : CorsPolicyBuilder) = - builder.WithOrigins("http://localhost:8080") - .AllowAnyMethod() - .AllowAnyHeader() - |> ignore + builder + .WithOrigins( + "http://localhost:5000", + "https://localhost:5001") + .AllowAnyMethod() + .AllowAnyHeader() + |> ignore let configureApp (app : IApplicationBuilder) = let env = app.ApplicationServices.GetService() - (match env.EnvironmentName with - | "Development" -> app.UseDeveloperExceptionPage() - | _ -> app.UseGiraffeErrorHandler(errorHandler)) - .UseHttpsRedirection() + (match env.IsDevelopment() with + | true -> + app.UseDeveloperExceptionPage() + | false -> + app .UseGiraffeErrorHandler(errorHandler) + .UseHttpsRedirection()) .UseCors(configureCors) .UseStaticFiles() .UseGiraffe(webApp) @@ -67,8 +72,7 @@ let configureServices (services : IServiceCollection) = services.AddGiraffe() |> ignore let configureLogging (builder : ILoggingBuilder) = - builder.AddFilter(fun l -> l.Equals LogLevel.Error) - .AddConsole() + builder.AddConsole() .AddDebug() |> ignore [] diff --git a/src/giraffe-template.nuspec b/src/giraffe-template.nuspec index 494f141..0d49579 100644 --- a/src/giraffe-template.nuspec +++ b/src/giraffe-template.nuspec @@ -2,7 +2,7 @@ giraffe-template - 1.2.0 + 1.3.0 Giraffe Template for dotnet-new A dotnet-new template for Giraffe web applications. A dotnet-new template for Giraffe web applications.