Skip to content

Commit 8f246cc

Browse files
committed
update configurations.md
1 parent 4772efb commit 8f246cc

File tree

1 file changed

+104
-0
lines changed

1 file changed

+104
-0
lines changed

content/en/dotnet-webapi-boilerplate/fundamentals/configurations.md

+104
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ Depends on the client consuming the WebAPI.
6868
```
6969
## Database
7070

71+
By default, the dbprovider is set to postgresql. You will also have to change the connection string that is defined in hangfire.json.
72+
7173
```json
7274
{
7375
"DatabaseSettings": {
@@ -76,3 +78,105 @@ Depends on the client consuming the WebAPI.
7678
}
7779
}
7880
```
81+
82+
For details about other database providers, [refer this page](http://localhost:1313/dotnet-webapi-boilerplate/general/getting-started/#setting-up-the-connection-string)
83+
84+
## Localization
85+
86+
The outgoing responses can be localized using this. The client would have to pass the following header to receive localized responses.
87+
88+
```
89+
Accept-Language: <local-key>
90+
```
91+
92+
Here, the locale-key can be anything like fr,de, it and so on. The default locale is set to english.
93+
94+
```json
95+
{
96+
"LocalizationSettings": {
97+
"EnableLocalization": true,
98+
"ResourcesPath": "Localization",
99+
"SupportedCultures": [
100+
"en-US",
101+
"en",
102+
"fr",
103+
"fr-FR",
104+
"de",
105+
"de-DE",
106+
"it",
107+
"it-IT",
108+
"pt",
109+
"nl",
110+
"nl-NL"
111+
],
112+
"DefaultRequestCulture": "en",
113+
"FallbackToParent": true
114+
}
115+
}
116+
```
117+
118+
## Logger
119+
120+
FSH internally uses Serilog for logging. Here is the configuration for logger.
121+
122+
```json
123+
{
124+
"LoggerSettings": {
125+
"AppName": "FSH.WebApi",
126+
"ElasticSearchUrl": "http://localhost:9200",
127+
"WriteToFile": true,
128+
"StructuredConsoleLogging": false
129+
}
130+
}
131+
```
132+
133+
ElasticSearchUrl -> If this is empty, serilog will ignore writing to elastic cache.
134+
WriteToFile -> JSON structured logging to file. These log files can be found under the ./src/Host/Logs folder.
135+
StructuredConsoleLogging -> This can be useful when deploying the application to AWS ECS, for better Cloudwatch logging.
136+
137+
## Mail
138+
139+
We use Ethereal, a fake SMTP Service for mocking email transactions. Don't worry, the included credentials are valid, but you can create your own as well. Check [ethereal](https://ethereal.email/)
140+
141+
```json
142+
{
143+
"MailSettings": {
144+
"DisplayName": "Mukesh Murugan",
145+
"From": "[email protected]",
146+
"Host": "smtp.ethereal.email",
147+
"Password": "AdEqEKB4QwWX9Xey82",
148+
"Port": 587,
149+
"UserName": "[email protected]"
150+
}
151+
}
152+
```
153+
154+
### Security
155+
156+
```json
157+
{
158+
"SecuritySettings": {
159+
"Provider": "Jwt",
160+
"RequireConfirmedAccount":true,
161+
"JwtSettings": {
162+
"key": "S0M3RAN0MS3CR3T!1!MAG1C!1!",
163+
"tokenExpirationInMinutes": 60,
164+
"refreshTokenExpirationInDays": 7
165+
},
166+
"AzureAd": {
167+
"Instance": "https://login.microsoftonline.com/",
168+
"Domain": "<Your Domain>.onmicrosoft.com",
169+
"TenantId": "organizations",
170+
"ClientId": "<Your ClientId of the AzureAd Server App Registration>",
171+
"Scopes": "access_as_user",
172+
"RootIssuer": "https://sts.windows.net/<Your AzureAd TenantId>/"
173+
},
174+
"Swagger": {
175+
"AuthorizationUrl": "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",
176+
"TokenUrl": "https://login.microsoftonline.com/organizations/oauth2/v2.0/token",
177+
"ApiScope": "api://<Your ClientId of the AzureAd Server App Registration>/access_as_user",
178+
"OpenIdClientId": "<Your ClientId of the AzureAd Client App Registration>"
179+
}
180+
}
181+
}
182+
```

0 commit comments

Comments
 (0)