Skip to content

Commit

Permalink
Updated dependencies in templates/samples and further improved the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RussBaz committed Nov 22, 2021
1 parent ceca128 commit d7ed19b
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 7 deletions.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,50 @@ app.Get "/" <- fun serv ->
serv.EndResponse ()
```
#### Config Parts
Config parts services help with reading, parsing and validating server settings.

`WebFrame` uses default ASP.NET Core configuration options.

In addition, it provides ways to quickly override the configs with inmemory values.
```F#
let app = App argv
// Overriding the config with custom values
app.Config.[ "Hello:Wolrd" ] <- "Value"
// Overriding connecition string for "MyConnection"
app.Config.ConnectionStrings "MyConnection" <- "host=localhost;"
app.Get "/" <- fun serv ->
// NOTE: Missing configs are Server Exceptions
// and therefore will result 5xx errors
// Trying to read config with given keys
// Returns None if not found
let c = serv.Config.String "Hello:World"
// It will throw MissingRequiredConfigException if the key is not found
// or cannot be parsed
let c = serv.Config.Required<string> "Hello:World"
// Returns None if not found or cannot be parsed
let c = serv.Config.Optional<string> "Hello:World"
// Returns a default value if not found or cannot be parsed
let c = serv.Config.Get "Hello:World" "N/A"
// Helpers for dealing with environments
// String properties (fixed for every request)
let a = serv.Config.ApplicationName
let e = serv.Config.EnvironmentName
// Bool properties (fixed for every request)
let r = serv.Config.IsDevelopment
let r = serv.Config.IsStaging
let r = serv.Config.IsProduction
// Returns true if teh environment name matches the provided one
let r = serv.Config.IsEnvironment "EnvironmentName"
serv.EndResponse ()
```
#### Body Parts
##### Form
##### Json
Expand Down
2 changes: 1 addition & 1 deletion samples/AdvancedServer/AdvancedServer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="RussBaz.WebFrame" Version="0.0.6" />
<PackageReference Include="RussBaz.WebFrame" Version="0.0.9" />
<PackageReference Update="FSharp.Core" Version="6.0.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion samples/LocalServer/LocalServer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="RussBaz.WebFrame" Version="0.0.6" />
<PackageReference Include="RussBaz.WebFrame" Version="0.0.9" />
<PackageReference Update="FSharp.Core" Version="6.0.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion samples/Minimal/Minimal.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="RussBaz.WebFrame" Version="0.0.6" />
<PackageReference Include="RussBaz.WebFrame" Version="0.0.9" />
<PackageReference Update="FSharp.Core" Version="6.0.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion samples/Modules/Modules.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="RussBaz.WebFrame" Version="0.0.6" />
<PackageReference Include="RussBaz.WebFrame" Version="0.0.9" />
<PackageReference Update="FSharp.Core" Version="6.0.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion samples/StandardServer/StandardServer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="RussBaz.WebFrame" Version="0.0.6" />
<PackageReference Include="RussBaz.WebFrame" Version="0.0.9" />
<PackageReference Update="FSharp.Core" Version="6.0.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion samples/TestServer/TestServer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="RussBaz.WebFrame" Version="0.0.6" />
<PackageReference Include="RussBaz.WebFrame" Version="0.0.9" />
<PackageReference Update="FSharp.Core" Version="6.0.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion templates/All/Minimal/Minimal.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="RussBaz.WebFrame" Version="0.0.8" />
<PackageReference Include="RussBaz.WebFrame" Version="0.0.9" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
Expand Down

0 comments on commit d7ed19b

Please sign in to comment.