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
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/servers/yarp/getting-started.md
+16-12Lines changed: 16 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ ai-usage: ai-assisted
12
12
13
13
# Getting Started with YARP
14
14
15
-
YARP is designed as a library that provides the core proxy functionality which you can then customize by adding or replacing modules. YARP is currently provided as a NuGet package and code snippets. We plan on providing a project template and pre-built executable (`.exe`) in the future.
15
+
YARP is designed as a library that provides the core proxy functionality which you can then customize by adding or replacing modules. YARP is currently provided as a NuGet package and code snippets. We plan on providing a project template and prebuilt executable (`.exe`) in the future.
16
16
17
17
YARP is implemented on top of .NET Core infrastructure and is usable on Windows, Linux or MacOS. Development can be done with the SDK and your favorite editor, [Microsoft Visual Studio](https://visualstudio.microsoft.com/vs/) or [Visual Studio Code](https://code.visualstudio.com/).
18
18
@@ -22,7 +22,7 @@ You can download the .NET SDK from https://dotnet.microsoft.com/download/dotnet/
22
22
23
23
Visual Studio support for .NET 8 is included in Visual Studio 2022 17.8.
24
24
25
-
###Create a new project
25
+
## Create a new project
26
26
27
27
A complete version of the project built using the steps below can be found at [Basic YARP Sample](https://github.com/microsoft/reverse-proxy/tree/release/latest/samples/BasicYarpSample).
28
28
@@ -34,17 +34,19 @@ dotnet new web -n MyProxy -f net8.0
34
34
35
35
Alternatively, create a new ASP.NET Core web application in Visual Studio 2022, choosing "Empty" for the project template.
Add a package reference for [`Yarp.ReverseProxy`](https://www.nuget.org/packages/Yarp.ReverseProxy), version 2.3.0 or later.
40
+
41
+
```dotnetcli
42
+
dotnet add package Yarp.ReverseProxy
43
43
```
44
44
45
-
### Add the YARP Middleware
45
+
[!INCLUDE[](~/includes/package-reference.md)]
46
46
47
-
Update Program.cs to use the YARP middleware:
47
+
## Add the YARP Middleware
48
+
49
+
Update the `Program` file to use the YARP Middleware:
48
50
49
51
```csharp
50
52
varbuilder=WebApplication.CreateBuilder(args);
@@ -63,7 +65,7 @@ The configuration can also be provided programmatically. For more information, s
63
65
64
66
Learn more about the available configuration options by looking at <xref:Yarp.ReverseProxy.Configuration.RouteConfig> and <xref:Yarp.ReverseProxy.Configuration.ClusterConfig>.
65
67
66
-
```JSON
68
+
```json
67
69
{
68
70
"Logging": {
69
71
"LogLevel": {
@@ -95,6 +97,8 @@ Learn more about the available configuration options by looking at <xref:Yarp.Re
95
97
}
96
98
```
97
99
98
-
### Running the project
100
+
## Run the project
101
+
102
+
When using the .NET CLU, use `dotnet run` called within the sample's directory or `dotnet run --project <path to .csproj file>`.
99
103
100
-
Use `dotnet run` called within the sample's directory or `dotnet run --project <path to .csproj file>`
104
+
In Visual Studio, start the app with the **Run** button.
0 commit comments