mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-23 22:22:51 +08:00
19 lines
545 B
C#
19 lines
545 B
C#
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Routing;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Ocelot.ApiGateway
|
|
{
|
|
public static class HelloExtensions
|
|
{
|
|
public static IRouteBuilder AddRouter(this IRouteBuilder routeBuilder,
|
|
IApplicationBuilder app)
|
|
{
|
|
routeBuilder.Routes.Add(new Route(new Router(),
|
|
"{*url}",
|
|
app.ApplicationServices.GetService<IInlineConstraintResolver>()));
|
|
|
|
return routeBuilder;
|
|
}
|
|
}
|
|
} |