Add URI configuration option

This commit is contained in:
2022-07-18 22:32:32 -04:00
parent 61e17038f8
commit 5d15de240d
3 changed files with 57 additions and 15 deletions

View File

@@ -41,13 +41,15 @@ let fetchPost (postId : string) =
}
```
### A standard way to translate JSON into a strongly-typed configuration
### A standard way to translate JSON or a URI into a strongly-typed configuration
```fsharp
/// type: DataConfig
let config = DataConfig.fromJsonFile "data-config.json"
// OR
let config = DataConfig.fromConfiguration (config.GetSection "RethinkDB")
// OR
let config = DataConfig.fromUri (config.GetConnectionString "RethinkDB")
/// type: IConnection
let conn = config.Connect ()