Closed neuecc closed 10 years ago
should use other middleware. for example
// Conditional Use
app.MapWhen(x => x.Request.Path.Value.StartsWith("/v1/"), ap =>
{
});
app.MapWhen(x => x.Request.Path.Value.StartsWith("/v2/"), ap =>
{
});
// Trim Version Path
app.Use((context, next) =>
{
context.Request.Path = new Microsoft.Owin.PathString(
Regex.Replace(context.Request.Path.Value, @"^/v[1-9]/", "/"));
return next();
});
host api/v1/a/b api/v2/a/b ... remove api/vs