Skip to content

Commit e6fce75

Browse files
committed
Merge branch 'develop'
2 parents c5862d7 + f8553e4 commit e6fce75

File tree

14 files changed

+80
-58
lines changed

14 files changed

+80
-58
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Whenever there is a new version of the Giraffe template you can update it by re-
4444
You can also explicitly set the version when installing the template:
4545

4646
```
47-
dotnet new -i "giraffe-template::1.0.0"
47+
dotnet new -i "giraffe-template::1.3.0"
4848
```
4949

5050
## Basics

RELEASE_NOTES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Release Notes
22
=============
33

4+
## 1.3.0
5+
6+
- Removed log filter
7+
- Improved default CORS policy
8+
- HTTPS redirection not during Development
9+
- Updated to Giraffe 5.0.0-rc-6 with Ply
10+
411
## 1.2.0
512

613
- Updated all templates to .NET 5 and Giraffe 5.0.0-rc-1

src/content/DotLiquid/paket.dependencies

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ storage: none
22
framework: auto-detect
33
source https://api.nuget.org/v3/index.json
44

5-
nuget Giraffe ~> 5.0.0-rc-1
5+
nuget Giraffe ~> 5.0.0-rc-6
66
nuget Giraffe.DotLiquid
7-
nuget TaskBuilder.fs
7+
nuget Ply
88
nuget Microsoft.NET.Test.Sdk
99
nuget Microsoft.AspNetCore.TestHost
1010
nuget xunit

src/content/DotLiquid/src/AppName.1/AppName.1.fsproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
</PropertyGroup>
88

99
<ItemGroup Condition="'$(Paket)' == false OR '$(Paket)' == ''">
10-
<PackageReference Include="Giraffe" Version="5.0.0-rc-1" />
11-
<PackageReference Include="Giraffe.DotLiquid" Version="2.0.*" />
12-
<PackageReference Include="TaskBuilder.fs" Version="2.1.*" />
10+
<PackageReference Include="Giraffe" Version="5.0.0-rc-6" />
11+
<PackageReference Include="Giraffe.DotLiquid" Version="3.0.0-rc-1" />
12+
<PackageReference Include="Ply" Version="0.3.*" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

src/content/DotLiquid/src/AppName.1/Program.fs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,22 @@ let errorHandler (ex : Exception) (logger : ILogger) =
4343
// ---------------------------------
4444

4545
let configureCors (builder : CorsPolicyBuilder) =
46-
builder.WithOrigins("http://localhost:8080")
47-
.AllowAnyMethod()
48-
.AllowAnyHeader()
49-
|> ignore
46+
builder
47+
.WithOrigins(
48+
"http://localhost:5000",
49+
"https://localhost:5001")
50+
.AllowAnyMethod()
51+
.AllowAnyHeader()
52+
|> ignore
5053

5154
let configureApp (app : IApplicationBuilder) =
5255
let env = app.ApplicationServices.GetService<IWebHostEnvironment>()
53-
(match env.EnvironmentName with
54-
| "Development" -> app.UseDeveloperExceptionPage()
55-
| _ -> app.UseGiraffeErrorHandler(errorHandler))
56-
.UseHttpsRedirection()
56+
(match env.IsDevelopment() with
57+
| true ->
58+
app.UseDeveloperExceptionPage()
59+
| false ->
60+
app .UseGiraffeErrorHandler(errorHandler)
61+
.UseHttpsRedirection())
5762
.UseCors(configureCors)
5863
.UseStaticFiles()
5964
.UseGiraffe(webApp)
@@ -63,8 +68,7 @@ let configureServices (services : IServiceCollection) =
6368
services.AddGiraffe() |> ignore
6469

6570
let configureLogging (builder : ILoggingBuilder) =
66-
builder.AddFilter(fun l -> l.Equals LogLevel.Error)
67-
.AddConsole()
71+
builder.AddConsole()
6872
.AddDebug() |> ignore
6973

7074
[<EntryPoint>]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Giraffe
22
Giraffe.DotLiquid
3-
TaskBuilder.fs
3+
Ply

src/content/Giraffe/src/AppName.1/AppName.1.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
</PropertyGroup>
88

99
<ItemGroup Condition="'$(Paket)' == false OR '$(Paket)' == ''">
10-
<PackageReference Include="Giraffe" Version="5.0.0-rc-1" />
10+
<PackageReference Include="Giraffe" Version="5.0.0-rc-6" />
1111
<PackageReference Include="Giraffe.ViewEngine" Version="1.3.*" />
12-
<PackageReference Include="TaskBuilder.fs" Version="2.1.*" />
12+
<PackageReference Include="Ply" Version="0.3.*" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

src/content/Giraffe/src/AppName.1/Program.fs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,22 @@ let errorHandler (ex : Exception) (logger : ILogger) =
7878
// ---------------------------------
7979

8080
let configureCors (builder : CorsPolicyBuilder) =
81-
builder.WithOrigins("http://localhost:8080")
82-
.AllowAnyMethod()
83-
.AllowAnyHeader()
84-
|> ignore
81+
builder
82+
.WithOrigins(
83+
"http://localhost:5000",
84+
"https://localhost:5001")
85+
.AllowAnyMethod()
86+
.AllowAnyHeader()
87+
|> ignore
8588

8689
let configureApp (app : IApplicationBuilder) =
8790
let env = app.ApplicationServices.GetService<IWebHostEnvironment>()
88-
(match env.EnvironmentName with
89-
| "Development" -> app.UseDeveloperExceptionPage()
90-
| _ -> app.UseGiraffeErrorHandler(errorHandler))
91-
.UseHttpsRedirection()
91+
(match env.IsDevelopment() with
92+
| true ->
93+
app.UseDeveloperExceptionPage()
94+
| false ->
95+
app .UseGiraffeErrorHandler(errorHandler)
96+
.UseHttpsRedirection())
9297
.UseCors(configureCors)
9398
.UseStaticFiles()
9499
.UseGiraffe(webApp)
@@ -98,8 +103,7 @@ let configureServices (services : IServiceCollection) =
98103
services.AddGiraffe() |> ignore
99104

100105
let configureLogging (builder : ILoggingBuilder) =
101-
builder.AddFilter(fun l -> l.Equals LogLevel.Error)
102-
.AddConsole()
106+
builder.AddConsole()
103107
.AddDebug() |> ignore
104108

105109
[<EntryPoint>]

src/content/None/src/AppName.1/AppName.1.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup Condition="'$(Paket)' == false OR '$(Paket)' == ''">
10-
<PackageReference Include="Giraffe" Version="5.0.0-rc-1" />
11-
<PackageReference Include="TaskBuilder.fs" Version="2.1.*" />
10+
<PackageReference Include="Giraffe" Version="5.0.0-rc-6" />
11+
<PackageReference Include="Ply" Version="0.3.*" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

src/content/None/src/AppName.1/HttpHandlers.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace AppName._1
33
module HttpHandlers =
44

55
open Microsoft.AspNetCore.Http
6-
open FSharp.Control.Tasks.V2.ContextInsensitive
6+
open FSharp.Control.Tasks
77
open Giraffe
88
open AppName._1.Models
99

0 commit comments

Comments
 (0)