Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinmoris committed Dec 9, 2020
2 parents c5862d7 + f8553e4 commit e6fce75
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/content/DotLiquid/paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/content/DotLiquid/src/AppName.1/AppName.1.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

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

<ItemGroup>
Expand Down
24 changes: 14 additions & 10 deletions src/content/DotLiquid/src/AppName.1/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IWebHostEnvironment>()
(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)
Expand All @@ -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

[<EntryPoint>]
Expand Down
2 changes: 1 addition & 1 deletion src/content/DotLiquid/src/AppName.1/paket.references
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Giraffe
Giraffe.DotLiquid
TaskBuilder.fs
Ply
4 changes: 2 additions & 2 deletions src/content/Giraffe/src/AppName.1/AppName.1.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

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

<ItemGroup>
Expand Down
24 changes: 14 additions & 10 deletions src/content/Giraffe/src/AppName.1/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IWebHostEnvironment>()
(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)
Expand All @@ -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

[<EntryPoint>]
Expand Down
4 changes: 2 additions & 2 deletions src/content/None/src/AppName.1/AppName.1.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

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

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/content/None/src/AppName.1/HttpHandlers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 14 additions & 10 deletions src/content/None/src/AppName.1/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IWebHostEnvironment>()
(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)

Expand All @@ -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

[<EntryPoint>]
Expand Down
9 changes: 4 additions & 5 deletions src/content/Razor/src/AppName.1/AppName.1.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
</PropertyGroup>

<ItemGroup Condition="'$(Paket)' == false OR '$(Paket)' == ''">
<PackageReference Include="Giraffe" Version="5.0.0-rc-1" />
<PackageReference Include="Giraffe.Razor" Version="5.0.*" />
<!-- TODO Upadte Giraffe.Razor directly -->
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.0" />
<PackageReference Include="TaskBuilder.fs" Version="2.1.*" />
<PackageReference Include="Giraffe" Version="5.0.0-rc-6" />
<PackageReference Include="Giraffe.Razor" Version="5.1.0-rc-2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.*" />
<PackageReference Include="Ply" Version="0.3.*" />
</ItemGroup>

<ItemGroup>
Expand Down
24 changes: 14 additions & 10 deletions src/content/Razor/src/AppName.1/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IWebHostEnvironment>()
(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)
Expand All @@ -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

[<EntryPoint>]
Expand Down
2 changes: 1 addition & 1 deletion src/giraffe-template.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>giraffe-template</id>
<version>1.2.0</version>
<version>1.3.0</version>
<title>Giraffe Template for dotnet-new</title>
<summary>A dotnet-new template for Giraffe web applications.</summary>
<description>A dotnet-new template for Giraffe web applications.</description>
Expand Down

0 comments on commit e6fce75

Please sign in to comment.