@ -1,34 +1,33 @@ | |||||
{ | { | ||||
"ReRoutes": [ | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "marketing.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/m/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "locations.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/l/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
} | |||||
], | |||||
"GlobalConfiguration": { | |||||
"RequestIdKey": "OcRequestId", | |||||
"AdministrationPath": "/administration" | |||||
} | |||||
} | |||||
"ReRoutes": [ | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "marketing.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/m/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "locations.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/l/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
} | |||||
], | |||||
"GlobalConfiguration": { | |||||
"RequestIdKey": "OcRequestId", | |||||
"AdministrationPath": "/administration" | |||||
} | |||||
} |
@ -1,34 +1,33 @@ | |||||
{ | { | ||||
"ReRoutes": [ | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "marketing.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/m/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "locations.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/l/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
} | |||||
"ReRoutes": [ | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "marketing.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/m/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "locations.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/l/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
} | |||||
], | |||||
"GlobalConfiguration": { | |||||
"RequestIdKey": "OcRequestId", | |||||
"AdministrationPath": "/administration" | |||||
} | |||||
], | |||||
"GlobalConfiguration": { | |||||
"RequestIdKey": "OcRequestId", | |||||
"AdministrationPath": "/administration" | |||||
} | |||||
} | } | ||||
@ -1,31 +1,28 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using System.Collections.Generic; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config | ||||
{ | { | ||||
public class UrlsConfig | |||||
{ | |||||
public class CatalogOperations | |||||
{ | |||||
public static string GetItemById(int id) => $"/api/v1/catalog/items/{id}"; | |||||
public static string GetItemsById(IEnumerable<int> ids) => $"/api/v1/catalog/items?ids={string.Join(',', ids)}"; | |||||
} | |||||
public class UrlsConfig | |||||
{ | |||||
public class CatalogOperations | |||||
{ | |||||
public static string GetItemById(int id) => $"/api/v1/catalog/items/{id}"; | |||||
public static string GetItemsById(IEnumerable<int> ids) => $"/api/v1/catalog/items?ids={string.Join(',', ids)}"; | |||||
} | |||||
public class BasketOperations | |||||
{ | |||||
public static string GetItemById(string id) => $"/api/v1/basket/{id}"; | |||||
public static string UpdateBasket() => "/api/v1/basket"; | |||||
} | |||||
public class BasketOperations | |||||
{ | |||||
public static string GetItemById(string id) => $"/api/v1/basket/{id}"; | |||||
public static string UpdateBasket() => "/api/v1/basket"; | |||||
} | |||||
public class OrdersOperations | |||||
{ | |||||
public static string GetOrderDraft() => "/api/v1/orders/draft"; | |||||
} | |||||
public class OrdersOperations | |||||
{ | |||||
public static string GetOrderDraft() => "/api/v1/orders/draft"; | |||||
} | |||||
public string Basket { get; set; } | |||||
public string Catalog { get; set; } | |||||
public string Orders { get; set; } | |||||
} | |||||
public string Basket { get; set; } | |||||
public string Catalog { get; set; } | |||||
public string Orders { get; set; } | |||||
} | |||||
} | } |
@ -1,18 +1,14 @@ | |||||
using Microsoft.AspNetCore.Mvc; | using Microsoft.AspNetCore.Mvc; | ||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | ||||
{ | { | ||||
[Route("")] | |||||
public class HomeController : Controller | |||||
{ | |||||
[HttpGet()] | |||||
public IActionResult Index() | |||||
{ | |||||
return new RedirectResult("~/swagger"); | |||||
} | |||||
} | |||||
[Route("")] | |||||
public class HomeController : Controller | |||||
{ | |||||
[HttpGet()] | |||||
public IActionResult Index() | |||||
{ | |||||
return new RedirectResult("~/swagger"); | |||||
} | |||||
} | |||||
} | } |
@ -1,42 +1,39 @@ | |||||
using Microsoft.AspNetCore.Authorization; | using Microsoft.AspNetCore.Authorization; | ||||
using Microsoft.AspNetCore.Mvc; | using Microsoft.AspNetCore.Mvc; | ||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | ||||
{ | { | ||||
[Route("api/v1/[controller]")] | |||||
[Authorize] | |||||
public class OrderController : Controller | |||||
{ | |||||
private readonly IBasketService _basketService; | |||||
private readonly IOrderApiClient _orderClient; | |||||
public OrderController(IBasketService basketService, IOrderApiClient orderClient) | |||||
{ | |||||
_basketService = basketService; | |||||
_orderClient = orderClient; | |||||
} | |||||
[Route("api/v1/[controller]")] | |||||
[Authorize] | |||||
public class OrderController : Controller | |||||
{ | |||||
private readonly IBasketService _basketService; | |||||
private readonly IOrderApiClient _orderClient; | |||||
public OrderController(IBasketService basketService, IOrderApiClient orderClient) | |||||
{ | |||||
_basketService = basketService; | |||||
_orderClient = orderClient; | |||||
} | |||||
[Route("draft/{basketId}")] | |||||
[HttpGet] | |||||
public async Task<IActionResult> GetOrderDraft(string basketId) | |||||
{ | |||||
if (string.IsNullOrEmpty(basketId)) | |||||
{ | |||||
return BadRequest("Need a valid basketid"); | |||||
} | |||||
// Get the basket data and build a order draft based on it | |||||
var basket = await _basketService.GetById(basketId); | |||||
if (basket == null) | |||||
{ | |||||
return BadRequest($"No basket found for id {basketId}"); | |||||
} | |||||
[Route("draft/{basketId}")] | |||||
[HttpGet] | |||||
public async Task<IActionResult> GetOrderDraft(string basketId) | |||||
{ | |||||
if (string.IsNullOrEmpty(basketId)) | |||||
{ | |||||
return BadRequest("Need a valid basketid"); | |||||
} | |||||
// Get the basket data and build a order draft based on it | |||||
var basket = await _basketService.GetById(basketId); | |||||
if (basket == null) | |||||
{ | |||||
return BadRequest($"No basket found for id {basketId}"); | |||||
} | |||||
var orderDraft = await _orderClient.GetOrderDraftFromBasket(basket); | |||||
return Ok(orderDraft); | |||||
} | |||||
} | |||||
var orderDraft = await _orderClient.GetOrderDraftFromBasket(basket); | |||||
return Ok(orderDraft); | |||||
} | |||||
} | |||||
} | } |
@ -1,33 +1,33 @@ | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters | ||||
{ | { | ||||
using Microsoft.AspNetCore.Authorization; | |||||
using Swashbuckle.AspNetCore.Swagger; | |||||
using Swashbuckle.AspNetCore.SwaggerGen; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using Microsoft.AspNetCore.Authorization; | |||||
using Swashbuckle.AspNetCore.Swagger; | |||||
using Swashbuckle.AspNetCore.SwaggerGen; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
namespace Basket.API.Infrastructure.Filters | |||||
{ | |||||
public class AuthorizeCheckOperationFilter : IOperationFilter | |||||
{ | |||||
public void Apply(Operation operation, OperationFilterContext context) | |||||
{ | |||||
// Check for authorize attribute | |||||
var hasAuthorize = context.ApiDescription.ControllerAttributes().OfType<AuthorizeAttribute>().Any() || | |||||
context.ApiDescription.ActionAttributes().OfType<AuthorizeAttribute>().Any(); | |||||
namespace Basket.API.Infrastructure.Filters | |||||
{ | |||||
public class AuthorizeCheckOperationFilter : IOperationFilter | |||||
{ | |||||
public void Apply(Operation operation, OperationFilterContext context) | |||||
{ | |||||
// Check for authorize attribute | |||||
var hasAuthorize = context.ApiDescription.ControllerAttributes().OfType<AuthorizeAttribute>().Any() || | |||||
context.ApiDescription.ActionAttributes().OfType<AuthorizeAttribute>().Any(); | |||||
if (hasAuthorize) | |||||
{ | |||||
operation.Responses.Add("401", new Response { Description = "Unauthorized" }); | |||||
operation.Responses.Add("403", new Response { Description = "Forbidden" }); | |||||
if (hasAuthorize) | |||||
{ | |||||
operation.Responses.Add("401", new Response { Description = "Unauthorized" }); | |||||
operation.Responses.Add("403", new Response { Description = "Forbidden" }); | |||||
operation.Security = new List<IDictionary<string, IEnumerable<string>>>(); | |||||
operation.Security.Add(new Dictionary<string, IEnumerable<string>> | |||||
{ | |||||
{ "oauth2", new [] { "Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator" } } | |||||
}); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
operation.Security = new List<IDictionary<string, IEnumerable<string>>>(); | |||||
operation.Security.Add(new Dictionary<string, IEnumerable<string>> | |||||
{ | |||||
{ "oauth2", new [] { "Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator" } } | |||||
}); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | } |
@ -1,20 +1,15 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | |||||
{ | { | ||||
public class AddBasketItemRequest | |||||
{ | |||||
public int CatalogItemId { get; set; } | |||||
public string BasketId { get; set; } | |||||
public class AddBasketItemRequest | |||||
{ | |||||
public int CatalogItemId { get; set; } | |||||
public string BasketId { get; set; } | |||||
public int Quantity { get; set; } | |||||
public int Quantity { get; set; } | |||||
public AddBasketItemRequest() | |||||
{ | |||||
Quantity = 1; | |||||
} | |||||
} | |||||
public AddBasketItemRequest() | |||||
{ | |||||
Quantity = 1; | |||||
} | |||||
} | |||||
} | } |
@ -1,31 +1,28 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using System.Collections.Generic; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
{ | { | ||||
public class BasketData | |||||
{ | |||||
public string BuyerId { get; set; } | |||||
public List<BasketDataItem> Items { get; set; } | |||||
public class BasketData | |||||
{ | |||||
public string BuyerId { get; set; } | |||||
public List<BasketDataItem> Items { get; set; } | |||||
public BasketData(string buyerId) | |||||
{ | |||||
BuyerId = buyerId; | |||||
Items = new List<BasketDataItem>(); | |||||
} | |||||
} | |||||
public BasketData(string buyerId) | |||||
{ | |||||
BuyerId = buyerId; | |||||
Items = new List<BasketDataItem>(); | |||||
} | |||||
} | |||||
public class BasketDataItem | |||||
{ | |||||
public string Id { get; set; } | |||||
public string ProductId { get; set; } | |||||
public string ProductName { get; set; } | |||||
public decimal UnitPrice { get; set; } | |||||
public decimal OldUnitPrice { get; set; } | |||||
public int Quantity { get; set; } | |||||
public string PictureUrl { get; set; } | |||||
public class BasketDataItem | |||||
{ | |||||
public string Id { get; set; } | |||||
public string ProductId { get; set; } | |||||
public string ProductName { get; set; } | |||||
public decimal UnitPrice { get; set; } | |||||
public decimal OldUnitPrice { get; set; } | |||||
public int Quantity { get; set; } | |||||
public string PictureUrl { get; set; } | |||||
} | |||||
} | |||||
} | } |
@ -1,20 +1,15 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | |||||
{ | { | ||||
public class CatalogItem | |||||
{ | |||||
public int Id { get; set; } | |||||
public class CatalogItem | |||||
{ | |||||
public int Id { get; set; } | |||||
public string Name { get; set; } | |||||
public string Name { get; set; } | |||||
public decimal Price { get; set; } | |||||
public decimal Price { get; set; } | |||||
public string PictureUri { get; set; } | |||||
public string PictureUri { get; set; } | |||||
} | |||||
} | |||||
} | } |
@ -1,33 +1,31 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using System.Collections.Generic; | |||||
using DateTime = System.DateTime; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
{ | { | ||||
public class OrderData | |||||
{ | |||||
public string OrderNumber { get; set; } | |||||
public DateTime Date { get; set; } | |||||
public string Status { get; set; } | |||||
public decimal Total { get; set; } | |||||
public string Description { get; set; } | |||||
public string City { get; set; } | |||||
public string Street { get; set; } | |||||
public string State { get; set; } | |||||
public string Country { get; set; } | |||||
public string ZipCode { get; set; } | |||||
public string CardNumber { get; set; } | |||||
public string CardHolderName { get; set; } | |||||
public bool IsDraft { get; set; } | |||||
public DateTime CardExpiration { get; set; } | |||||
public string CardExpirationShort { get; set; } | |||||
public string CardSecurityNumber { get; set; } | |||||
public class OrderData | |||||
{ | |||||
public string OrderNumber { get; set; } | |||||
public DateTime Date { get; set; } | |||||
public string Status { get; set; } | |||||
public decimal Total { get; set; } | |||||
public string Description { get; set; } | |||||
public string City { get; set; } | |||||
public string Street { get; set; } | |||||
public string State { get; set; } | |||||
public string Country { get; set; } | |||||
public string ZipCode { get; set; } | |||||
public string CardNumber { get; set; } | |||||
public string CardHolderName { get; set; } | |||||
public bool IsDraft { get; set; } | |||||
public DateTime CardExpiration { get; set; } | |||||
public string CardExpirationShort { get; set; } | |||||
public string CardSecurityNumber { get; set; } | |||||
public int CardTypeId { get; set; } | |||||
public int CardTypeId { get; set; } | |||||
public string Buyer { get; set; } | |||||
public string Buyer { get; set; } | |||||
public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>(); | |||||
} | |||||
public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>(); | |||||
} | |||||
} | } |
@ -1,17 +1,12 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | |||||
{ | { | ||||
public class OrderItemData | |||||
{ | |||||
public int ProductId { get; set; } | |||||
public string ProductName { get; set; } | |||||
public decimal UnitPrice { get; set; } | |||||
public decimal Discount { get; set; } | |||||
public int Units { get; set; } | |||||
public string PictureUrl { get; set; } | |||||
} | |||||
public class OrderItemData | |||||
{ | |||||
public int ProductId { get; set; } | |||||
public string ProductName { get; set; } | |||||
public decimal UnitPrice { get; set; } | |||||
public decimal Discount { get; set; } | |||||
public int Units { get; set; } | |||||
public string PictureUrl { get; set; } | |||||
} | |||||
} | } |
@ -1,31 +1,28 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using System.Collections.Generic; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
{ | { | ||||
public class UpdateBasketItemsRequest | |||||
{ | |||||
public string BasketId { get; set; } | |||||
public class UpdateBasketItemsRequest | |||||
{ | |||||
public ICollection<UpdateBasketItemData> Updates { get; set; } | |||||
public string BasketId { get; set; } | |||||
public UpdateBasketItemsRequest() | |||||
{ | |||||
Updates = new List<UpdateBasketItemData>(); | |||||
} | |||||
} | |||||
public ICollection<UpdateBasketItemData> Updates { get; set; } | |||||
public class UpdateBasketItemData | |||||
{ | |||||
public string BasketItemId { get; set; } | |||||
public int NewQty { get; set; } | |||||
public UpdateBasketItemsRequest() | |||||
{ | |||||
Updates = new List<UpdateBasketItemData>(); | |||||
} | |||||
} | |||||
public UpdateBasketItemData() | |||||
{ | |||||
NewQty = 0; | |||||
} | |||||
} | |||||
public class UpdateBasketItemData | |||||
{ | |||||
public string BasketItemId { get; set; } | |||||
public int NewQty { get; set; } | |||||
public UpdateBasketItemData() | |||||
{ | |||||
NewQty = 0; | |||||
} | |||||
} | |||||
} | } |
@ -1,21 +1,18 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using System.Collections.Generic; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
{ | { | ||||
public class UpdateBasketRequest | |||||
{ | |||||
public string BuyerId { get; set; } | |||||
public class UpdateBasketRequest | |||||
{ | |||||
public string BuyerId { get; set; } | |||||
public IEnumerable<UpdateBasketRequestItemData> Items { get; set; } | |||||
} | |||||
public IEnumerable<UpdateBasketRequestItemData> Items { get; set; } | |||||
} | |||||
public class UpdateBasketRequestItemData | |||||
{ | |||||
public string Id { get; set; } // Basket id | |||||
public int ProductId { get; set; } // Catalog item id | |||||
public int Quantity { get; set; } // Quantity | |||||
} | |||||
public class UpdateBasketRequestItemData | |||||
{ | |||||
public string Id { get; set; } // Basket id | |||||
public int ProductId { get; set; } // Catalog item id | |||||
public int Quantity { get; set; } // Quantity | |||||
} | |||||
} | } |
@ -1,36 +1,29 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.IO; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.AspNetCore; | |||||
using Microsoft.AspNetCore.Hosting; | |||||
using Microsoft.Extensions.Configuration; | |||||
using Microsoft.Extensions.Logging; | |||||
using static Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions; | |||||
using static Microsoft.AspNetCore.Hosting.WebHostExtensions; | |||||
using IWebHost = Microsoft.AspNetCore.Hosting.IWebHost; | |||||
using WebHost = Microsoft.AspNetCore.WebHost; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator | ||||
{ | { | ||||
public class Program | |||||
{ | |||||
public static void Main(string[] args) | |||||
{ | |||||
BuildWebHost(args).Run(); | |||||
} | |||||
public class Program | |||||
{ | |||||
public static void Main(string[] args) | |||||
=> BuildWebHost(args).Run(); | |||||
public static IWebHost BuildWebHost(string[] args) => | |||||
WebHost | |||||
.CreateDefaultBuilder(args) | |||||
.ConfigureAppConfiguration(cb => | |||||
{ | |||||
var sources = cb.Sources; | |||||
sources.Insert(3, new Microsoft.Extensions.Configuration.Json.JsonConfigurationSource() | |||||
{ | |||||
Optional = true, | |||||
Path = "appsettings.localhost.json", | |||||
ReloadOnChange = false | |||||
}); | |||||
}) | |||||
.UseStartup<Startup>() | |||||
.Build(); | |||||
} | |||||
public static IWebHost BuildWebHost(string[] args) => | |||||
WebHost | |||||
.CreateDefaultBuilder(args) | |||||
.ConfigureAppConfiguration(cb => | |||||
{ | |||||
var sources = cb.Sources; | |||||
sources.Insert(3, new Extensions.Configuration.Json.JsonConfigurationSource() | |||||
{ | |||||
Optional = true, | |||||
Path = "appsettings.localhost.json", | |||||
ReloadOnChange = false | |||||
}); | |||||
}) | |||||
.UseStartup<Startup>() | |||||
.Build(); | |||||
} | |||||
} | } |
@ -1,39 +1,42 @@ | |||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; | |||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | |||||
using Microsoft.Extensions.Logging; | |||||
using Microsoft.Extensions.Logging; | |||||
using Microsoft.Extensions.Options; | using Microsoft.Extensions.Options; | ||||
using Newtonsoft.Json; | |||||
using System.Net.Http; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using HttpClient = System.Net.Http.HttpClient; | |||||
using JsonConvert = Newtonsoft.Json.JsonConvert; | |||||
using StringContent = System.Net.Http.StringContent; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
{ | { | ||||
public class BasketService : IBasketService | |||||
{ | |||||
using BasketData = Models.BasketData; | |||||
using BasketOperations = Config.UrlsConfig.BasketOperations; | |||||
using UrlsConfig = Config.UrlsConfig; | |||||
private readonly HttpClient _apiClient; | |||||
private readonly ILogger<BasketService> _logger; | |||||
private readonly UrlsConfig _urls; | |||||
public class BasketService : IBasketService | |||||
{ | |||||
public BasketService(HttpClient httpClient,ILogger<BasketService> logger, IOptions<UrlsConfig> config) | |||||
{ | |||||
_apiClient = httpClient; | |||||
_logger = logger; | |||||
_urls = config.Value; | |||||
} | |||||
private readonly HttpClient _apiClient; | |||||
private readonly ILogger<BasketService> _logger; | |||||
private readonly UrlsConfig _urls; | |||||
public async Task<BasketData> GetById(string id) | |||||
{ | |||||
var data = await _apiClient.GetStringAsync(_urls.Basket + UrlsConfig.BasketOperations.GetItemById(id)); | |||||
var basket = !string.IsNullOrEmpty(data) ? JsonConvert.DeserializeObject<BasketData>(data) : null; | |||||
return basket; | |||||
} | |||||
public BasketService(HttpClient httpClient, ILogger<BasketService> logger, IOptions<UrlsConfig> config) | |||||
{ | |||||
_apiClient = httpClient; | |||||
_logger = logger; | |||||
_urls = config.Value; | |||||
} | |||||
public async Task Update(BasketData currentBasket) | |||||
{ | |||||
var basketContent = new StringContent(JsonConvert.SerializeObject(currentBasket), System.Text.Encoding.UTF8, "application/json"); | |||||
public async Task<BasketData> GetById(string id) | |||||
{ | |||||
var data = await _apiClient.GetStringAsync(_urls.Basket + BasketOperations.GetItemById(id)); | |||||
var basket = !string.IsNullOrEmpty(data) ? JsonConvert.DeserializeObject<BasketData>(data) : null; | |||||
return basket; | |||||
} | |||||
var data = await _apiClient.PostAsync(_urls.Basket + UrlsConfig.BasketOperations.UpdateBasket(), basketContent); | |||||
} | |||||
} | |||||
public async Task Update(BasketData currentBasket) | |||||
{ | |||||
var basketContent = new StringContent(JsonConvert.SerializeObject(currentBasket), System.Text.Encoding.UTF8, "application/json"); | |||||
var data = await _apiClient.PostAsync(_urls.Basket + BasketOperations.UpdateBasket(), basketContent); | |||||
} | |||||
} | |||||
} | } |
@ -1,42 +1,43 @@ | |||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; | |||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | |||||
using Microsoft.Extensions.Logging; | |||||
using Microsoft.Extensions.Logging; | |||||
using Microsoft.Extensions.Options; | using Microsoft.Extensions.Options; | ||||
using Newtonsoft.Json; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Net.Http; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using HttpClient = System.Net.Http.HttpClient; | |||||
using JsonConvert = Newtonsoft.Json.JsonConvert; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
{ | { | ||||
public class CatalogService : ICatalogService | |||||
{ | |||||
private readonly HttpClient _httpClient; | |||||
private readonly ILogger<CatalogService> _logger; | |||||
private readonly UrlsConfig _urls; | |||||
public CatalogService(HttpClient httpClient, ILogger<CatalogService> logger, IOptions<UrlsConfig> config) | |||||
{ | |||||
_httpClient = httpClient; | |||||
_logger = logger; | |||||
_urls = config.Value; | |||||
} | |||||
public async Task<CatalogItem> GetCatalogItem(int id) | |||||
{ | |||||
var stringContent = await _httpClient.GetStringAsync(_urls.Catalog + UrlsConfig.CatalogOperations.GetItemById(id)); | |||||
var catalogItem = JsonConvert.DeserializeObject<CatalogItem>(stringContent); | |||||
return catalogItem; | |||||
} | |||||
public async Task<IEnumerable<CatalogItem>> GetCatalogItems(IEnumerable<int> ids) | |||||
{ | |||||
var stringContent = await _httpClient.GetStringAsync(_urls.Catalog + UrlsConfig.CatalogOperations.GetItemsById(ids)); | |||||
var catalogItems = JsonConvert.DeserializeObject<CatalogItem[]>(stringContent); | |||||
return catalogItems; | |||||
} | |||||
} | |||||
using CatalogItem = Models.CatalogItem; | |||||
using UrlsConfig = Config.UrlsConfig; | |||||
public class CatalogService : ICatalogService | |||||
{ | |||||
private readonly HttpClient _httpClient; | |||||
private readonly ILogger<CatalogService> _logger; | |||||
private readonly UrlsConfig _urls; | |||||
public CatalogService(HttpClient httpClient, ILogger<CatalogService> logger, IOptions<UrlsConfig> config) | |||||
{ | |||||
_httpClient = httpClient; | |||||
_logger = logger; | |||||
_urls = config.Value; | |||||
} | |||||
public async Task<CatalogItem> GetCatalogItem(int id) | |||||
{ | |||||
var stringContent = await _httpClient.GetStringAsync(_urls.Catalog + UrlsConfig.CatalogOperations.GetItemById(id)); | |||||
var catalogItem = JsonConvert.DeserializeObject<CatalogItem>(stringContent); | |||||
return catalogItem; | |||||
} | |||||
public async Task<IEnumerable<CatalogItem>> GetCatalogItems(IEnumerable<int> ids) | |||||
{ | |||||
var stringContent = await _httpClient.GetStringAsync(_urls.Catalog + UrlsConfig.CatalogOperations.GetItemsById(ids)); | |||||
var catalogItems = JsonConvert.DeserializeObject<CatalogItem[]>(stringContent); | |||||
return catalogItems; | |||||
} | |||||
} | |||||
} | } |
@ -1,15 +1,13 @@ | |||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using System.Threading.Tasks; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
{ | { | ||||
public interface IBasketService | |||||
{ | |||||
Task<BasketData> GetById(string id); | |||||
Task Update(BasketData currentBasket); | |||||
using BasketData = Models.BasketData; | |||||
} | |||||
public interface IBasketService | |||||
{ | |||||
Task<BasketData> GetById(string id); | |||||
Task Update(BasketData currentBasket); | |||||
} | |||||
} | } |
@ -1,14 +1,13 @@ | |||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Collections.Generic; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
{ | { | ||||
public interface ICatalogService | |||||
{ | |||||
Task<CatalogItem> GetCatalogItem(int id); | |||||
Task<IEnumerable<CatalogItem>> GetCatalogItems(IEnumerable<int> ids); | |||||
} | |||||
using CatalogItem = Models.CatalogItem; | |||||
public interface ICatalogService | |||||
{ | |||||
Task<CatalogItem> GetCatalogItem(int id); | |||||
Task<IEnumerable<CatalogItem>> GetCatalogItems(IEnumerable<int> ids); | |||||
} | |||||
} | } |
@ -1,13 +1,12 @@ | |||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Threading.Tasks; | |||||
using System.Threading.Tasks; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
{ | { | ||||
public interface IOrderApiClient | |||||
{ | |||||
Task<OrderData> GetOrderDraftFromBasket(BasketData basket); | |||||
} | |||||
using BasketData = Models.BasketData; | |||||
using OrderData = Models.OrderData; | |||||
public interface IOrderApiClient | |||||
{ | |||||
Task<OrderData> GetOrderDraftFromBasket(BasketData basket); | |||||
} | |||||
} | } |
@ -1,38 +1,41 @@ | |||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; | |||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | |||||
using Microsoft.Extensions.Logging; | |||||
using Microsoft.Extensions.Logging; | |||||
using Microsoft.Extensions.Options; | using Microsoft.Extensions.Options; | ||||
using Newtonsoft.Json; | |||||
using System.Net.Http; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using HttpClient = System.Net.Http.HttpClient; | |||||
using JsonConvert = Newtonsoft.Json.JsonConvert; | |||||
using StringContent = System.Net.Http.StringContent; | |||||
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
{ | { | ||||
public class OrderApiClient : IOrderApiClient | |||||
{ | |||||
using BasketData = Models.BasketData; | |||||
using OrderData = Models.OrderData; | |||||
using UrlsConfig = Config.UrlsConfig; | |||||
private readonly HttpClient _apiClient; | |||||
private readonly ILogger<OrderApiClient> _logger; | |||||
private readonly UrlsConfig _urls; | |||||
public class OrderApiClient : IOrderApiClient | |||||
{ | |||||
public OrderApiClient(HttpClient httpClient, ILogger<OrderApiClient> logger, IOptions<UrlsConfig> config) | |||||
{ | |||||
_apiClient = httpClient; | |||||
_logger = logger; | |||||
_urls = config.Value; | |||||
} | |||||
private readonly HttpClient _apiClient; | |||||
private readonly ILogger<OrderApiClient> _logger; | |||||
private readonly UrlsConfig _urls; | |||||
public async Task<OrderData> GetOrderDraftFromBasket(BasketData basket) | |||||
{ | |||||
var url = _urls.Orders + UrlsConfig.OrdersOperations.GetOrderDraft(); | |||||
var content = new StringContent(JsonConvert.SerializeObject(basket), System.Text.Encoding.UTF8, "application/json"); | |||||
var response = await _apiClient.PostAsync(url, content); | |||||
public OrderApiClient(HttpClient httpClient, ILogger<OrderApiClient> logger, IOptions<UrlsConfig> config) | |||||
{ | |||||
_apiClient = httpClient; | |||||
_logger = logger; | |||||
_urls = config.Value; | |||||
} | |||||
response.EnsureSuccessStatusCode(); | |||||
public async Task<OrderData> GetOrderDraftFromBasket(BasketData basket) | |||||
{ | |||||
var url = _urls.Orders + UrlsConfig.OrdersOperations.GetOrderDraft(); | |||||
var content = new StringContent(JsonConvert.SerializeObject(basket), System.Text.Encoding.UTF8, "application/json"); | |||||
var response = await _apiClient.PostAsync(url, content); | |||||
var ordersDraftResponse = await response.Content.ReadAsStringAsync(); | |||||
response.EnsureSuccessStatusCode(); | |||||
return JsonConvert.DeserializeObject<OrderData>(ordersDraftResponse); | |||||
} | |||||
} | |||||
var ordersDraftResponse = await response.Content.ReadAsStringAsync(); | |||||
return JsonConvert.DeserializeObject<OrderData>(ordersDraftResponse); | |||||
} | |||||
} | |||||
} | } |
@ -1,15 +1,15 @@ | |||||
{ | { | ||||
"Logging": { | |||||
"IncludeScopes": false, | |||||
"Debug": { | |||||
"LogLevel": { | |||||
"Default": "Warning" | |||||
} | |||||
}, | |||||
"Console": { | |||||
"LogLevel": { | |||||
"Default": "Warning" | |||||
} | |||||
} | |||||
} | |||||
"Logging": { | |||||
"IncludeScopes": false, | |||||
"Debug": { | |||||
"LogLevel": { | |||||
"Default": "Warning" | |||||
} | |||||
}, | |||||
"Console": { | |||||
"LogLevel": { | |||||
"Default": "Warning" | |||||
} | |||||
} | |||||
} | |||||
} | } |
@ -1,8 +1,8 @@ | |||||
{ | { | ||||
"urls": { | |||||
"basket": "http://localhost:55105", | |||||
"catalog": "http://localhost:55101", | |||||
"orders": "http://localhost:55102", | |||||
"identity": "http://localhost:55105" | |||||
} | |||||
"urls": { | |||||
"basket": "http://localhost:55105", | |||||
"catalog": "http://localhost:55101", | |||||
"orders": "http://localhost:55102", | |||||
"identity": "http://localhost:55105" | |||||
} | |||||
} | } |
@ -1,130 +1,129 @@ | |||||
{ | { | ||||
"ReRoutes": [ | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "catalog.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/c/{everything}", | |||||
"UpstreamHttpMethod": [ "GET" ] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "basket.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/b/{everything}", | |||||
"UpstreamHttpMethod": [], | |||||
"AuthenticationOptions": { | |||||
"AuthenticationProviderKey": "IdentityApiKey", | |||||
"AllowedScopes": [] | |||||
} | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "ordering.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/o/{everything}", | |||||
"UpstreamHttpMethod": [], | |||||
"AuthenticationOptions": { | |||||
"AuthenticationProviderKey": "IdentityApiKey", | |||||
"AllowedScopes": [] | |||||
} | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "webshoppingagg", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/{everything}", | |||||
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ], | |||||
"AuthenticationOptions": { | |||||
"AuthenticationProviderKey": "IdentityApiKey", | |||||
"AllowedScopes": [] | |||||
} | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "ordering.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/orders-api/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "ordering.signalrhub", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/hub/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "basket.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/basket-api/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "catalog.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/catalog-api/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "payment.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/payment-api/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
} | |||||
"ReRoutes": [ | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "catalog.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/c/{everything}", | |||||
"UpstreamHttpMethod": [ "GET" ] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "basket.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/b/{everything}", | |||||
"UpstreamHttpMethod": [], | |||||
"AuthenticationOptions": { | |||||
"AuthenticationProviderKey": "IdentityApiKey", | |||||
"AllowedScopes": [] | |||||
} | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/api/{version}/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "ordering.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/api/{version}/o/{everything}", | |||||
"UpstreamHttpMethod": [], | |||||
"AuthenticationOptions": { | |||||
"AuthenticationProviderKey": "IdentityApiKey", | |||||
"AllowedScopes": [] | |||||
} | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "webshoppingagg", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/{everything}", | |||||
"UpstreamHttpMethod": [ "POST", "PUT", "GET" ], | |||||
"AuthenticationOptions": { | |||||
"AuthenticationProviderKey": "IdentityApiKey", | |||||
"AllowedScopes": [] | |||||
} | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "ordering.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/orders-api/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "ordering.signalrhub", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/hub/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "basket.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/basket-api/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "catalog.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/catalog-api/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
}, | |||||
{ | |||||
"DownstreamPathTemplate": "/{everything}", | |||||
"DownstreamScheme": "http", | |||||
"DownstreamHostAndPorts": [ | |||||
{ | |||||
"Host": "payment.api", | |||||
"Port": 80 | |||||
} | |||||
], | |||||
"UpstreamPathTemplate": "/payment-api/{everything}", | |||||
"UpstreamHttpMethod": [] | |||||
} | |||||
], | |||||
"GlobalConfiguration": { | |||||
"RequestIdKey": "OcRequestId", | |||||
"AdministrationPath": "/administration" | |||||
} | |||||
} | |||||
], | |||||
"GlobalConfiguration": { | |||||
"RequestIdKey": "OcRequestId", | |||||
"AdministrationPath": "/administration" | |||||
} | |||||
} |