Browse Source

Add CORS configuration documentation for Single Layer Web Application template

pull/21728/head
ahmetfarukulu 1 year ago
parent
commit
ea86704c34
  1. 11
      docs/en/solution-templates/layered-web-application/cors-configuration.md
  2. 32
      docs/en/solution-templates/single-layer-web-application/cors-configuration.md

11
docs/en/solution-templates/layered-web-application/cors-configuration.md

@ -16,12 +16,13 @@
Cross-Origin Resource Sharing (CORS) is a security feature that allows web applications to make requests to a different domain than the one that served the web page.
In the layered solution template, CORS configuration is applied in the following cases:
- If you select the [Tiered solution](solution-structure.md#tiered-structure-).
- If you choose [Angular](web-applications.md#angular) as the web application type.
- If you choose [No UI](web-applications.md#no-ui) as the web application type.
In the layered solution template, CORS configuration is applied in the following cases:
- If you select the [Tiered solution](solution-structure.md#tiered-structure-).
- If you choose [Angular](web-applications.md#angular) as the web application type.
- If you choose [Blazor WebAssembly](web-applications.md#blazor-webassembly) as the web application type.
- If you choose [No UI](web-applications.md#no-ui) as the web application type.
The CORS settings are configured in the `appsettings.json` file of the corresponding project. Typically, the web application serves as the entry point for front-end applications, so it must be configured to accept requests from different origins.
The CORS settings are configured in the `appsettings.json` file of the corresponding project. Typically, the web application serves as the entry point for front-end applications, so it must be configured to accept requests from different origins.
The default configuration in `appsettings.json` is as follows:

32
docs/en/solution-templates/single-layer-web-application/cors-configuration.md

@ -0,0 +1,32 @@
# Single Layer Solution: CORS Configuration
```json
//[doc-nav]
{
"Previous": {
"Name": "BLOB Storing",
"Path": "solution-templates/single-layer-web-application/blob-storing"
}
}
```
Cross-Origin Resource Sharing (CORS) is a security feature that allows web applications to make requests to a different domain than the one that served the web page.
In the single-layer solution template, CORS configuration is applied in the following cases:
- When [Angular](web-applications.md#angular) is selected as the web application type.
- When [Blazor WebAssembly](web-applications.md#blazor-webassembly) is selected as the web application type.
- When [No UI](web-applications.md#no-ui) is selected as the web application type.
CORS settings are configured in the `appsettings.json` file of the corresponding project. The web application usually serves as the entry point for front-end applications, so it must be set up to accept requests from different origins.
The default configuration in `appsettings.json` is as follows:
```json
{
"App": {
"CorsOrigins": "https://*.MyProjectName.com"
}
}
```
You can modify the `CorsOrigins` property to include additional domains or wildcard subdomains as needed for your application.
Loading…
Cancel
Save