You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Light Freshness Edit: ASP.NET - Startup, gRPC, YARP, SPA (#37053)
* refresh content + include
* edit external refs
* Apply suggestions from code review
Co-authored-by: Wade Pickett <wpickett@microsoft.com>
* Fix character escaping in IStartupFilter documentation
Updated the text in the IStartupFilter section to escape special characters for proper rendering.
* Update aspnetcore/grpc/index.md
Co-authored-by: Wade Pickett <wpickett@microsoft.com>
---------
Co-authored-by: Wade Pickett <wpickett@microsoft.com>
Copy file name to clipboardExpand all lines: aspnetcore/client-side/spa/intro.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
1
---
2
-
title: Overview of Single Page Apps (SPAs) in ASP.NET Core
2
+
title: Overview of Single Page Apps (SPAs) - ASP.NET Core
3
3
author: wadepickett
4
4
ms.author: wpickett
5
5
monikerRange: '>= aspnetcore-6.0'
6
-
description: Overview of Single Page Apps (SPAs) in ASP.NET Core
7
-
ms.date: 09/12/2023
6
+
description: Learn how to get started with Single Page Apps (SPAs) in ASP.NET Core and find links to tutorials for detailed procedures.
7
+
ms.date: 04/24/2026
8
8
uid: spa/intro
9
+
10
+
# customer intent: As an ASP.NET developer, I want to get an overview of SPAs in ASP.NET Core, so I can determine the appropriate tutorial to create apps.
9
11
---
10
12
# Overview of Single Page Apps (SPAs) in ASP.NET Core
11
13
@@ -27,6 +29,10 @@ For more information, see [JavaScript and TypeScript in Visual Studio](/visualst
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/yarp/config-files.md
+71-50Lines changed: 71 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,26 @@
1
1
---
2
2
uid: fundamentals/servers/yarp/config-files
3
3
title: YARP Configuration Files
4
-
description: YARP Configuration Files
4
+
description: Explore how to work with YARP configuration files, examine the file structure and properties, define routes, clusters, and sources, and load proxy configuration.
5
5
author: wadepickett
6
6
ms.author: wpickett
7
-
ms.date: 2/6/2025
7
+
ms.date: 04/24/2026
8
8
ms.topic: concept-article
9
9
content_well_notification: AI-contribution
10
10
ai-usage: ai-assisted
11
-
---
12
11
12
+
# customer intent: As an ASP.NET developer, I want to get started with the YARP library, so I can learn how customize the modules.
13
+
---
13
14
# YARP Configuration Files
14
15
15
-
## Introduction
16
-
The reverse proxy can load configuration for routes and clusters from files using the IConfiguration abstraction from Microsoft.Extensions. The examples given here use JSON, but any IConfiguration source should work. The configuration will also be updated without restarting the proxy if the source file changes.
16
+
The reverse proxy can load configuration for routes and clusters from files by using the [IConfiguration](/dotnet/api/microsoft.extensions.configuration.iconfiguration) abstraction from Microsoft.Extensions.
17
+
18
+
This article provides example proxy configuration for YARP. Although the configuration example uses JSON, any `IConfiguration` source should work. Also, the configuration updates without restarting the proxy when the source file changes.
19
+
20
+
## Load the proxy configuration
21
+
22
+
To load the proxy configuration from the `IConfiguration` instance, add the following code in the _Program.cs_ file:
17
23
18
-
## Loading Configuration
19
-
To load the proxy configuration from IConfiguration add the following code in Program.cs:
20
24
```csharp
21
25
usingMicrosoft.AspNetCore.Builder;
22
26
usingMicrosoft.Extensions.DependencyInjection;
@@ -35,33 +39,41 @@ app.MapReverseProxy();
35
39
36
40
app.Run();
37
41
```
38
-
**Note**: For details about middleware ordering see [here](/aspnet/core/fundamentals/middleware/#middleware-order).
39
42
40
-
Configuration can be modified during the load sequence using [Configuration Filters](xref:fundamentals/servers/yarp/config-filters).
43
+
> [!NOTE]
44
+
> For details about middleware ordering, see [ASP.NET Core Middleware > Middleware order](/aspnet/core/fundamentals/middleware/#middleware-order).
45
+
46
+
Configuration can be modified during the load sequence by using [YARP configuration filters](xref:fundamentals/servers/yarp/config-filters).
47
+
48
+
## Load from multiple configuration sources
49
+
50
+
Starting in version 1.1, YARP supports loading the proxy configuration from multiple sources. You can call the `LoadFromConfig` method multiple times and reference different `IConfiguration` sections. You can also combine the call with a different config source, such as InMemory. Routes can reference clusters from other sources.
41
51
42
-
## Multiple Configuration Sources
43
-
As of 1.1, YARP supports loading the proxy configuration from multiple sources. LoadFromConfig may be called multiple times referencing different IConfiguration sections or may be combine with a different config source like InMemory. Routes can reference clusters from other sources. Note merging partial config from different sources for a given route or cluster is not supported.
52
+
> [!NOTE]
53
+
> Merging partial config from different sources for a given route or cluster isn't supported.
File-based configuration is dynamically mapped to the types in [Yarp.ReverseProxy.Configuration](xref:Yarp.ReverseProxy.Configuration) namespace by an [IProxyConfigProvider](xref:Yarp.ReverseProxy.Configuration.IProxyConfigProvider) implementation converts at application start and each time the configuration changes.
69
+
## Review the configuration contract
70
+
71
+
File-based configuration is dynamically mapped to the types in the [Yarp.ReverseProxy.Configuration](xref:Yarp.ReverseProxy.Configuration) namespace by an [IProxyConfigProvider](xref:Yarp.ReverseProxy.Configuration.IProxyConfigProvider) implementation. The contract converts at application start and each time the configuration changes.
60
72
61
-
## Configuration Structure
62
-
The configuration consists of a named section that you specified above via `Configuration.GetSection("ReverseProxy")`, and contains subsections for routes and clusters.
73
+
## Examine the configuration structure
74
+
75
+
The configuration consists of a named section and subsections for routes and clusters. In the previous example, the named section is `Configuration.GetSection("ReverseProxy")`.
63
76
64
-
Example:
65
77
```json
66
78
{
67
79
"ReverseProxy": {
@@ -87,29 +99,35 @@ Example:
87
99
}
88
100
```
89
101
90
-
### Routes
102
+
### Define configuration routes
103
+
104
+
The `Routes` section is an unordered collection of route matches and their associated configuration.
91
105
92
-
The routes section is an unordered collection of route matches and their associated configuration. A route requires at least the following fields:
106
+
Each route requires at least the following fields:
93
107
94
-
* RouteId - a unique name
95
-
* ClusterId - refers to the name of an entry in the clusters section.
96
-
* Match - contains either a Hosts array or a Path pattern string. Path is an ASP.NET Core route template that can be defined as [explained here](/aspnet/core/fundamentals/routing#route-templates).
108
+
*`RouteId`: A unique name for the route.
109
+
*`ClusterId`: The name of an entry in the `Clusters` section.
110
+
*`Match`: Either a `Hosts` array or a `Path` pattern string. You can define the path by using [Routing in ASP.NET Core > Route templates](/aspnet/core/fundamentals/routing#route-templates).
97
111
98
-
Route matching is based on the most specific routes having highest precedence as described [here](/aspnet/core/fundamentals/routing#url-matching). Explicit ordering can be achieved using the `order` field, with lower values taking higher priority.
112
+
Route matching is based on the most specific routes having highest precedence, as described in [URL matching](/aspnet/core/fundamentals/routing#url-matching). Explicit ordering can be achieved by using the `order` field, where lower values take higher priority.
99
113
100
-
[Headers](xref:fundamentals/servers/yarp/header-routing), [Authorization](xref:fundamentals/servers/yarp/authn-authz), [CORS](xref:fundamentals/servers/yarp/cors), and other routebased policies can be configured on each route entry. For additional fields see [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig).
114
+
[YARP headers](xref:fundamentals/servers/yarp/header-routing), [authentication and authorization](xref:fundamentals/servers/yarp/authn-authz), [cross-origin requests (CORS)](xref:fundamentals/servers/yarp/cors), and other route-based policies can be configured on each route entry. For other fields, see the [RouteConfig](xref:Yarp.ReverseProxy.Configuration.RouteConfig) reference.
101
115
102
-
The proxy will apply the given matching criteria and policies, and then pass off the request to the specified cluster.
116
+
The proxy applies the given matching criteria and policies, and passes off the request to the specified cluster.
103
117
104
-
### Clusters
105
-
The clusters section is an unordered collection of named clusters. A cluster primarily contains a collection of named destinations and their addresses, any of which is considered capable of handling requests for a given route. The proxy will process the request according to the route and cluster configuration in order to select a destination.
118
+
### Define configuration clusters
106
119
107
-
For additional fields see [ClusterConfig](xref:Yarp.ReverseProxy.Configuration.ClusterConfig).
120
+
The `Clusters` section is an unordered collection of named clusters. A cluster primarily contains a collection of named destinations and their addresses, any of which is considered capable of handling requests for a given route. The proxy processes the request according to the route and cluster configuration to select a destination.
121
+
122
+
For other fields, see the [ClusterConfig](xref:Yarp.ReverseProxy.Configuration.ClusterConfig) reference.
123
+
124
+
## Review all config properties
125
+
126
+
The following JSON example shows all properties available for the YARP proxy configuration.
108
127
109
-
## All config properties
110
128
```json
111
129
{
112
-
// Base URLs the server listens on, must be configured independently of the routes below
130
+
// Base URLs the server listens on, must be configured independently of the routes defined below
@@ -236,4 +254,7 @@ For additional fields see [ClusterConfig](xref:Yarp.ReverseProxy.Configuration.C
236
254
}
237
255
```
238
256
239
-
For more information see [logging configuration](diagnosing-yarp-issues.md#logging) and [HTTP client configuration](xref:fundamentals/servers/yarp/http-client-config).
0 commit comments