private async Task <HttpRouter> GetRouter() { var resolver = new HttpRouteResolver(); var headMatcher = new HttpFromOwinReqCtxMatcher(); // copy methods and headers as is //using my custom SaaS tenant matcher address matcher headMatcher.Chain(new MatchHostAddressForTenant()); await resolver.AddMatcherAsync(headMatcher, 0); return(new HttpRouter(resolver)); }
// creates an OWIN pipeline that has the router embeded // in it private async Task <HttpRouter> GetRouter() { var resolver = new HttpRouteResolver(); var headMatcher = new HttpFromOwinReqCtxMatcher(); // copy methods and headers as is // route from Owin Server Listening Address to server 2 headMatcher.Chain(new SetAddressListMatcher(RouterTestSuit.Srv02HostNamePort), new HostAddressMatcher(RouterTestSuit.OwinRouterSrvHostNamePort, StringMatchType.UriHostandPortMatch)); await resolver.AddMatcherAsync(headMatcher, 0); return(new HttpRouter(resolver)); }