-
-
Save fzankl/eded3c5e7a8b73006d259c996f6bbddd to your computer and use it in GitHub Desktop.
YARP - Startup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Startup | |
{ | |
private readonly IConfiguration _configuration; | |
public Startup(IConfiguration configuration) | |
{ | |
_configuration = configuration; | |
} | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services | |
.AddReverseProxy(); | |
.LoadFromConfig(_configuration.GetSection("ReverseProxy")); | |
} | |
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | |
{ | |
if (env.IsDevelopment()) | |
{ | |
app.UseDeveloperExceptionPage(); | |
} | |
app.UseRouting(); | |
app.UseEndpoints(endpoints => | |
{ | |
endpoints.MapReverseProxy(); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment