|
@@ -17,7 +17,6 @@ module Common =
|
|
|
|
|
|
type JsonMode =
|
|
type JsonMode =
|
|
| System
|
|
| System
|
|
- | Utf8
|
|
|
|
| Newtonsoft
|
|
| Newtonsoft
|
|
|
|
|
|
let FortuneComparer =
|
|
let FortuneComparer =
|
|
@@ -109,12 +108,11 @@ module Main =
|
|
open Microsoft.Extensions.Hosting
|
|
open Microsoft.Extensions.Hosting
|
|
open Microsoft.Extensions.Logging
|
|
open Microsoft.Extensions.Logging
|
|
|
|
|
|
- [<EntryPoint>]
|
|
|
|
|
|
+ [<EntryPoint>]
|
|
let main args =
|
|
let main args =
|
|
let jsonMode =
|
|
let jsonMode =
|
|
match args with
|
|
match args with
|
|
| [| "newtonsoft" |] -> Newtonsoft
|
|
| [| "newtonsoft" |] -> Newtonsoft
|
|
- | [| "utf8" |] -> Utf8
|
|
|
|
| _ -> System
|
|
| _ -> System
|
|
|
|
|
|
printfn $"Running with %A{jsonMode} JSON serializer"
|
|
printfn $"Running with %A{jsonMode} JSON serializer"
|
|
@@ -124,9 +122,6 @@ module Main =
|
|
| System ->
|
|
| System ->
|
|
SystemTextJson.Serializer(SystemTextJson.Serializer.DefaultOptions)
|
|
SystemTextJson.Serializer(SystemTextJson.Serializer.DefaultOptions)
|
|
:> Json.ISerializer
|
|
:> Json.ISerializer
|
|
- | Utf8 ->
|
|
|
|
- Utf8Json.Serializer(Utf8Json.Serializer.DefaultResolver)
|
|
|
|
- :> Json.ISerializer
|
|
|
|
| Newtonsoft ->
|
|
| Newtonsoft ->
|
|
NewtonsoftJson.Serializer(NewtonsoftJson.Serializer.DefaultSettings)
|
|
NewtonsoftJson.Serializer(NewtonsoftJson.Serializer.DefaultSettings)
|
|
:> Json.ISerializer
|
|
:> Json.ISerializer
|
|
@@ -136,7 +131,7 @@ module Main =
|
|
builder.Services
|
|
builder.Services
|
|
.AddSingleton(jsonSerializer)
|
|
.AddSingleton(jsonSerializer)
|
|
.AddGiraffe() |> ignore
|
|
.AddGiraffe() |> ignore
|
|
-
|
|
|
|
|
|
+
|
|
builder.Logging.ClearProviders() |> ignore
|
|
builder.Logging.ClearProviders() |> ignore
|
|
|
|
|
|
let app = builder.Build()
|
|
let app = builder.Build()
|
|
@@ -145,5 +140,5 @@ module Main =
|
|
.UseGiraffe HttpHandlers.endpoints |> ignore
|
|
.UseGiraffe HttpHandlers.endpoints |> ignore
|
|
|
|
|
|
app.Run()
|
|
app.Run()
|
|
-
|
|
|
|
|
|
+
|
|
0
|
|
0
|