Configuration of envoy routes and minor code fixes
This commit is contained in:
parent
9b57122f7a
commit
d68c9e40aa
@ -133,8 +133,8 @@ ExecKube -cmd 'create -f services.yaml'
|
||||
|
||||
ExecKube -cmd 'create -f internalurls.yaml'
|
||||
ExecKube -cmd 'create configmap urls `
|
||||
--from-literal=PicBaseUrl=http://$($externalDns)/webshoppingapigw/api/v1/c/catalog/items/[0]/pic/ `
|
||||
--from-literal=Marketing_PicBaseUrl=http://$($externalDns)/webmarketingapigw/api/v1/m/campaigns/[0]/pic/ `
|
||||
--from-literal=PicBaseUrl=http://$($externalDns)/webshoppingapigw/c/api/v1/catalog/items/[0]/pic/ `
|
||||
--from-literal=Marketing_PicBaseUrl=http://$($externalDns)/webmarketingapigw/m/api/v1/campaigns/[0]/pic/ `
|
||||
--from-literal=mvc_e=http://$($externalDns)/webmvc `
|
||||
--from-literal=marketingapigw_e=http://$($externalDns)/webmarketingapigw `
|
||||
--from-literal=webshoppingapigw_e=http://$($externalDns)/webshoppingapigw `
|
||||
|
@ -24,9 +24,13 @@ static_resources:
|
||||
- "*"
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/api/v1/m/"
|
||||
prefix: "/m/"
|
||||
route:
|
||||
prefix_rewrite: "/marketing-api/"
|
||||
cluster: marketing
|
||||
- match:
|
||||
prefix: "/marketing-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: marketing
|
||||
http_filters:
|
||||
- name: envoy.router
|
||||
|
@ -12,7 +12,9 @@ service:
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
annotations: {}
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: "/"
|
||||
ingress.kubernetes.io/rewrite-target: "/"
|
||||
tls: []
|
||||
|
||||
resources: {}
|
||||
|
@ -24,20 +24,32 @@ static_resources:
|
||||
- "*"
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/api/v1/c/"
|
||||
prefix: "/c/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
prefix_rewrite: "/catalog-api/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/api/v1/o/"
|
||||
prefix: "/catalog-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/o/"
|
||||
route:
|
||||
prefix_rewrite: "/order-api/"
|
||||
cluster: ordering
|
||||
- match:
|
||||
prefix: "/api/v1/b/"
|
||||
prefix: "/order-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/b/"
|
||||
route:
|
||||
prefix_rewrite: "/basket-api/"
|
||||
cluster: basket
|
||||
- match:
|
||||
prefix: "/basket-api/"
|
||||
route:
|
||||
cluster: basket
|
||||
- match:
|
||||
prefix: "/"
|
||||
route:
|
||||
|
@ -12,7 +12,9 @@ service:
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
annotations: {}
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: "/"
|
||||
ingress.kubernetes.io/rewrite-target: "/"
|
||||
tls: []
|
||||
|
||||
resources: {}
|
||||
|
@ -24,9 +24,13 @@ static_resources:
|
||||
- "*"
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/api/v1/m/"
|
||||
prefix: "/m/"
|
||||
route:
|
||||
prefix_rewrite: "/marketing-api/"
|
||||
cluster: marketing
|
||||
- match:
|
||||
prefix: "/marketing-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: marketing
|
||||
http_filters:
|
||||
- name: envoy.router
|
||||
|
@ -12,7 +12,9 @@ service:
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
annotations: {}
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: "/"
|
||||
ingress.kubernetes.io/rewrite-target: "/"
|
||||
tls: []
|
||||
|
||||
resources: {}
|
||||
|
@ -24,20 +24,32 @@ static_resources:
|
||||
- "*"
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/api/v1/c/"
|
||||
prefix: "/c/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
prefix_rewrite: "/catalog-api/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/api/v1/o/"
|
||||
prefix: "/catalog-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/o/"
|
||||
route:
|
||||
prefix_rewrite: "/order-api/"
|
||||
cluster: ordering
|
||||
- match:
|
||||
prefix: "/api/v1/b/"
|
||||
prefix: "/order-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/b/"
|
||||
route:
|
||||
prefix_rewrite: "/basket-api/"
|
||||
cluster: basket
|
||||
- match:
|
||||
prefix: "/basket-api/"
|
||||
route:
|
||||
cluster: basket
|
||||
- match:
|
||||
prefix: "/"
|
||||
route:
|
||||
|
@ -12,7 +12,9 @@ service:
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
annotations: {}
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: "/"
|
||||
ingress.kubernetes.io/rewrite-target: "/"
|
||||
tls: []
|
||||
|
||||
resources: {}
|
||||
|
@ -13,7 +13,7 @@ metadata:
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
catalog__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.catalog.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
|
||||
catalog__PicBaseUrl: http://{{ $webshoppingapigw }}/api/v1/c/catalog/items/[0]/pic/
|
||||
catalog__PicBaseUrl: http://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/
|
||||
catalog__AzureStorageEnabled: "{{ .Values.inf.misc.useAzureStorage }}"
|
||||
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
|
||||
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
|
||||
|
@ -83,11 +83,11 @@ if ($deployCharts) {
|
||||
if ($chartsToDeploy -eq "*" -or $chartsToDeploy.Contains($chart)) {
|
||||
Write-Host "Installing: $chart" -ForegroundColor Green
|
||||
if ($useCustomRegistry) {
|
||||
helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --name="$appName-$chart" $chart
|
||||
helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --set inf.k8s.local=$useLocalk8s --name="$appName-$chart" $chart
|
||||
}
|
||||
else {
|
||||
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
|
||||
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --name="$appName-$chart" $chart
|
||||
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set "ingress.hosts={$dns}" --set image.tag=$imageTag --set image.pullPolicy=$imagePullPolicy --set inf.mesh.enabled=$useMesh --set inf.k8s.local=$useLocalk8s --name="$appName-$chart" $chart
|
||||
}
|
||||
}
|
||||
}
|
||||
|
28
k8s/helm/identity-api/templates/ingress-dockerk8s.yaml
Normal file
28
k8s/helm/identity-api/templates/ingress-dockerk8s.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- if .Values.inf.k8s.local -}}
|
||||
{{- $ingressPath := include "pathBase" . -}}
|
||||
{{- $serviceName := .Values.app.svc.identity }}
|
||||
{{- $name := include "identity-api.fullname" . -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $name }}-local
|
||||
labels:
|
||||
app: {{ template "identity-api.name" . }}
|
||||
chart: {{ template "identity-api.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
rules:
|
||||
- http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: {{ $serviceName }}
|
||||
servicePort: http
|
||||
path: {{ $ingressPath }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
@ -41,6 +41,7 @@ inf:
|
||||
key: "" # App insights to use
|
||||
k8s: # inf.k8s defines Kubernetes cluster global config
|
||||
dns: "" # k8s external DNS. This value or ip value MUST BE PROVIDED
|
||||
local: false # True when deploying on "local K8s" provided by Docker Desktop.
|
||||
misc: # inf.misc contains miscellaneous configuration related to infrastructure
|
||||
useLoadTest: false # If running under loading test or not
|
||||
useAzureStorage: false # If catalog api uses azure storage or not
|
||||
|
@ -1,3 +1,5 @@
|
||||
# This file contains common annotations when using AKS with Http Application Routing
|
||||
|
||||
ingress:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: addon-http-application-routing
|
||||
|
@ -1,3 +1,5 @@
|
||||
# This file contains common ingress annotations when using Kubernetes included in Docker Desktop
|
||||
|
||||
ingress:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
|
@ -173,7 +173,7 @@ The file `inf.yaml` contains the description of the infrastructure used. File is
|
||||
Using Azure storage for catalog (and marketing) photos is not directly supported, but you can accomplish it by editing the file `k8s/helm/catalog-api/templates/configmap.yaml`. Search for lines:
|
||||
|
||||
```
|
||||
catalog__PicBaseUrl: http://{{ $webshoppingapigw }}/api/v1/c/catalog/items/[0]/pic/
|
||||
catalog__PicBaseUrl: http://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/
|
||||
```
|
||||
|
||||
And replace it for:
|
||||
@ -185,7 +185,7 @@ catalog__PicBaseUrl: http://<url-of-the-storage>/
|
||||
In the same way, to use Azure storage for the marketing service, have to edit the file `k8s/helm/marketing-api/templates/configmap.yaml` and replacing the line:
|
||||
|
||||
```
|
||||
marketing__PicBaseUrl: http://{{ $webshoppingapigw }}/api/v1/c/catalog/items/[0]/pic/
|
||||
marketing__PicBaseUrl: http://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/
|
||||
```
|
||||
|
||||
by:
|
||||
|
@ -23,4 +23,4 @@ data:
|
||||
marketing__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.marketing.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
|
||||
marketing__MongoConnectionString: mongodb://{{ $mongo }}
|
||||
marketing__MongoDatabase: {{ .Values.inf.mongo.marketing.database }}
|
||||
marketing__PicBaseUrl: http://{{ $webshoppingapigw }}/api/v1/c/catalog/items/[0]/pic/
|
||||
marketing__PicBaseUrl: http://{{ $webshoppingapigw }}/c/api/v1/catalog/items/[0]/pic/
|
@ -3,7 +3,6 @@
|
||||
{{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}}
|
||||
{{- $mvc := include "url-of" (list .Values.app.ingress.entries.mvc .) -}}
|
||||
|
||||
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
|
28
k8s/helm/webmvc/templates/ingress-dockerk8s.yaml
Normal file
28
k8s/helm/webmvc/templates/ingress-dockerk8s.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- if .Values.inf.k8s.local -}}
|
||||
{{- $ingressPath := include "pathBase" . -}}
|
||||
{{- $serviceName := .Values.app.svc.mvc }}
|
||||
{{- $name := include "webmvc.fullname" . -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $name }}-local
|
||||
labels:
|
||||
app: {{ template "webmvc.name" . }}
|
||||
chart: {{ template "webmvc.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
rules:
|
||||
- http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: {{ $serviceName }}
|
||||
servicePort: http
|
||||
path: {{ $ingressPath }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
@ -24,9 +24,13 @@ static_resources:
|
||||
- "*"
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/api/v1/m/"
|
||||
prefix: "/m/"
|
||||
route:
|
||||
prefix_rewrite: "/marketing-api/"
|
||||
cluster: marketing
|
||||
- match:
|
||||
prefix: "/marketing-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: marketing
|
||||
http_filters:
|
||||
- name: envoy.router
|
||||
|
@ -24,20 +24,32 @@ static_resources:
|
||||
- "*"
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/api/v1/c/"
|
||||
prefix: "/c/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
prefix_rewrite: "/catalog-api/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/api/v1/o/"
|
||||
prefix: "/catalog-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/o/"
|
||||
route:
|
||||
prefix_rewrite: "/order-api/"
|
||||
cluster: ordering
|
||||
- match:
|
||||
prefix: "/api/v1/b/"
|
||||
prefix: "/order-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/b/"
|
||||
route:
|
||||
prefix_rewrite: "/basket-api/"
|
||||
cluster: basket
|
||||
- match:
|
||||
prefix: "/basket-api/"
|
||||
route:
|
||||
cluster: basket
|
||||
- match:
|
||||
prefix: "/"
|
||||
route:
|
||||
|
@ -24,9 +24,13 @@ static_resources:
|
||||
- "*"
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/api/v1/m/"
|
||||
prefix: "/m/"
|
||||
route:
|
||||
prefix_rewrite: "/marketing-api/"
|
||||
cluster: marketing
|
||||
- match:
|
||||
prefix: "/marketing-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: marketing
|
||||
http_filters:
|
||||
- name: envoy.router
|
||||
|
@ -24,20 +24,32 @@ static_resources:
|
||||
- "*"
|
||||
routes:
|
||||
- match:
|
||||
prefix: "/api/v1/c/"
|
||||
prefix: "/c/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
prefix_rewrite: "/catalog-api/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/api/v1/o/"
|
||||
prefix: "/catalog-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/o/"
|
||||
route:
|
||||
prefix_rewrite: "/order-api/"
|
||||
cluster: ordering
|
||||
- match:
|
||||
prefix: "/api/v1/b/"
|
||||
prefix: "/order-api/"
|
||||
route:
|
||||
prefix_rewrite: "/api/v1/"
|
||||
cluster: catalog
|
||||
- match:
|
||||
prefix: "/b/"
|
||||
route:
|
||||
prefix_rewrite: "/basket-api/"
|
||||
cluster: basket
|
||||
- match:
|
||||
prefix: "/basket-api/"
|
||||
route:
|
||||
cluster: basket
|
||||
- match:
|
||||
prefix: "/"
|
||||
route:
|
||||
|
@ -66,14 +66,9 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
|
||||
app.UseCors("CorsPolicy");
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseSwagger().UseSwaggerUI(c =>
|
||||
{
|
||||
|
@ -67,11 +67,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
|
||||
app.UseCors("CorsPolicy");
|
||||
app.UseHttpsRedirection();
|
||||
|
@ -12,7 +12,7 @@ namespace eShopOnContainers.Core.Services.Basket
|
||||
private readonly IRequestProvider _requestProvider;
|
||||
private readonly IFixUriService _fixUriService;
|
||||
|
||||
private const string ApiUrlBase = "api/v1/b/basket";
|
||||
private const string ApiUrlBase = "b/api/v1/basket";
|
||||
|
||||
public BasketService(IRequestProvider requestProvider, IFixUriService fixUriService)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ namespace eShopOnContainers.Core.Services.Catalog
|
||||
private readonly IRequestProvider _requestProvider;
|
||||
private readonly IFixUriService _fixUriService;
|
||||
|
||||
private const string ApiUrlBase = "api/v1/c/catalog";
|
||||
private const string ApiUrlBase = "c/api/v1/catalog";
|
||||
|
||||
public CatalogService(IRequestProvider requestProvider, IFixUriService fixUriService)
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ namespace eShopOnContainers.Core.Services.Marketing
|
||||
private readonly IRequestProvider _requestProvider;
|
||||
private readonly IFixUriService _fixUriService;
|
||||
|
||||
private const string ApiUrlBase = "api/v1/m/campaigns";
|
||||
private const string ApiUrlBase = "m/api/v1/campaigns";
|
||||
|
||||
public CampaignService(IRequestProvider requestProvider, IFixUriService fixUriService)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ namespace eShopOnContainers.Core.Services.Order
|
||||
{
|
||||
private readonly IRequestProvider _requestProvider;
|
||||
|
||||
private const string ApiUrlBase = "api/v1/o/orders";
|
||||
private const string ApiUrlBase = "o/api/v1/orders";
|
||||
|
||||
public OrderService(IRequestProvider requestProvider)
|
||||
{
|
||||
|
@ -153,7 +153,6 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
|
||||
app.UseForwardedHeaders();
|
||||
// Adds IdentityServer
|
||||
app.UseIdentityServer();
|
||||
app.UseHttpsRedirection();
|
||||
app.UseRouting();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
|
||||
_settings = settings;
|
||||
_logger =logger;
|
||||
|
||||
_basketByPassUrl = $"{_settings.Value.PurchaseUrl}/api/v1/b/basket";
|
||||
_basketByPassUrl = $"{_settings.Value.PurchaseUrl}/b/api/v1/basket";
|
||||
_purchaseUrl = $"{_settings.Value.PurchaseUrl}/api/v1";
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
_httpClient = httpClient;
|
||||
_logger = logger;
|
||||
|
||||
_remoteServiceBaseUrl = $"{_settings.Value.MarketingUrl}/api/v1/m/campaigns/";
|
||||
_remoteServiceBaseUrl = $"{_settings.Value.MarketingUrl}/m/api/v1/campaigns/";
|
||||
}
|
||||
|
||||
public async Task<Campaign> GetCampaigns(int pageSize, int pageIndex)
|
||||
|
@ -25,7 +25,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
|
||||
_settings = settings;
|
||||
_logger = logger;
|
||||
|
||||
_remoteServiceBaseUrl = $"{_settings.Value.PurchaseUrl}/api/v1/c/catalog/";
|
||||
_remoteServiceBaseUrl = $"{_settings.Value.PurchaseUrl}/c/api/v1/catalog/";
|
||||
}
|
||||
|
||||
public async Task<Catalog> GetCatalogItems(int page, int take, int? brand, int? type)
|
||||
|
@ -22,7 +22,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services
|
||||
_httpClient = httpClient;
|
||||
_settings = settings;
|
||||
|
||||
_remoteServiceBaseUrl = $"{settings.Value.PurchaseUrl}/api/v1/o/orders";
|
||||
_remoteServiceBaseUrl = $"{settings.Value.PurchaseUrl}/o/api/v1/orders";
|
||||
}
|
||||
|
||||
async public Task<Order> GetOrder(ApplicationUser user, string id)
|
||||
|
@ -14,6 +14,7 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.IdentityModel.Logging;
|
||||
using Polly;
|
||||
using Polly.Extensions.Http;
|
||||
using StackExchange.Redis;
|
||||
@ -46,7 +47,9 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
||||
.AddDevspaces()
|
||||
.AddHttpClientServices(Configuration);
|
||||
//.AddHttpClientLogging(Configuration) //Opt-in HttpClientLogging config
|
||||
|
||||
|
||||
IdentityModelEventSource.ShowPII = true; // Caution! Do NOT use in production: https://aka.ms/IdentityModel/PII
|
||||
|
||||
services.AddControllers();
|
||||
|
||||
services.AddCustomAuthentication(Configuration);
|
||||
@ -66,7 +69,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Error");
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
var pathBase = Configuration["PATH_BASE"];
|
||||
@ -87,7 +89,6 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
||||
|
||||
WebContextSeed.Seed(app, env, loggerFactory);
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseRouting();
|
||||
|
||||
app.UseAuthentication();
|
||||
|
@ -68,7 +68,7 @@ export class BasketService {
|
||||
}
|
||||
|
||||
setBasketCheckout(basketCheckout): Observable<boolean> {
|
||||
let url = this.basketUrl + '/api/v1/b/basket/checkout';
|
||||
let url = this.basketUrl + '/b/api/v1/basket/checkout';
|
||||
return this.service.postWithId(url, basketCheckout).pipe(map((response: any) => {
|
||||
this.basketEvents.orderCreated();
|
||||
return true;
|
||||
@ -76,7 +76,7 @@ export class BasketService {
|
||||
}
|
||||
|
||||
getBasket(): Observable<IBasket> {
|
||||
let url = this.basketUrl + '/api/v1/b/basket/' + this.basket.buyerId;
|
||||
let url = this.basketUrl + '/b/api/v1/basket/' + this.basket.buyerId;
|
||||
return this.service.get(url).pipe(map((response: any) => {
|
||||
if (response.status === 204) {
|
||||
return null;
|
||||
|
@ -29,7 +29,7 @@ export class CampaignsService {
|
||||
}
|
||||
|
||||
getCampaigns(pageIndex: number, pageSize: number): Observable<ICampaign> {
|
||||
let url = this.marketingUrl + '/api/v1/m/campaigns/user';
|
||||
let url = this.marketingUrl + '/m/api/v1/campaigns/user';
|
||||
url = url + '?pageIndex=' + pageIndex + '&pageSize=' + pageSize;
|
||||
|
||||
return this.service.get(url).pipe(map((response: any) => {
|
||||
@ -38,7 +38,7 @@ export class CampaignsService {
|
||||
}
|
||||
|
||||
getCampaign(id: number): Observable<ICampaignItem> {
|
||||
let url = this.marketingUrl + '/api/v1/m/campaigns/' + id;
|
||||
let url = this.marketingUrl + '/m/api/v1/campaigns/' + id;
|
||||
|
||||
return this.service.get(url).pipe(map((response: any) => {
|
||||
return response;
|
||||
|
@ -18,9 +18,9 @@ export class CatalogService {
|
||||
|
||||
constructor(private service: DataService, private configurationService: ConfigurationService) {
|
||||
this.configurationService.settingsLoaded$.subscribe(x => {
|
||||
this.catalogUrl = this.configurationService.serverSettings.purchaseUrl + '/api/v1/c/catalog/items';
|
||||
this.brandUrl = this.configurationService.serverSettings.purchaseUrl + '/api/v1/c/catalog/catalogbrands';
|
||||
this.typesUrl = this.configurationService.serverSettings.purchaseUrl + '/api/v1/c/catalog/catalogtypes';
|
||||
this.catalogUrl = this.configurationService.serverSettings.purchaseUrl + '/c/api/v1/catalog/items';
|
||||
this.brandUrl = this.configurationService.serverSettings.purchaseUrl + '/c/api/v1/catalog/catalogbrands';
|
||||
this.typesUrl = this.configurationService.serverSettings.purchaseUrl + '/c/api/v1/catalog/catalogtypes';
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ export class OrdersService {
|
||||
}
|
||||
|
||||
getOrders(): Observable<IOrder[]> {
|
||||
let url = this.ordersUrl + '/api/v1/o/orders';
|
||||
let url = this.ordersUrl + '/o/api/v1/orders';
|
||||
|
||||
return this.service.get(url).pipe(map((response: any) => {
|
||||
return response;
|
||||
@ -33,7 +33,7 @@ export class OrdersService {
|
||||
}
|
||||
|
||||
getOrder(id: number): Observable<IOrderDetail> {
|
||||
let url = this.ordersUrl + '/api/v1/o/orders/' + id;
|
||||
let url = this.ordersUrl + '/o/api/v1/orders/' + id;
|
||||
|
||||
return this.service.get(url).pipe(map((response: any) => {
|
||||
return response;
|
||||
|
@ -69,11 +69,7 @@ namespace eShopConContainers.WebSPA
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
// Configure XSRF middleware, This pattern is for SPA style applications where XSRF token is added on Index page
|
||||
// load and passed back token on every subsequent async request
|
||||
// app.Use(async (context, next) =>
|
||||
|
@ -47,8 +47,6 @@ namespace WebStatus
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Home/Error");
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
var pathBase = Configuration["PATH_BASE"];
|
||||
@ -65,7 +63,6 @@ namespace WebStatus
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseRouting();
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ services:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- ASPNETCORE_URLS=http://0.0.0.0:80
|
||||
- ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word}
|
||||
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/api/v1/c/catalog/items/[0]/pic/}
|
||||
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/c/api/v1/catalog/items/[0]/pic/}
|
||||
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
|
||||
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
|
||||
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
|
||||
@ -114,7 +114,7 @@ services:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- ASPNETCORE_URLS=http://0.0.0.0:80
|
||||
- ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sql-data-test;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word}
|
||||
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/api/v1/c/catalog/items/[0]/pic/}
|
||||
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/c/api/v1/catalog/items/[0]/pic/}
|
||||
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq-test}
|
||||
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
|
||||
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
|
||||
|
@ -78,7 +78,7 @@ services:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- ConnectionString=${ESHOP_AZURE_CATALOG_DB:-Server=sqldata;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word}
|
||||
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/api/v1/c/catalog/items/[0]/pic/} #Local: You need to open your local dev-machine firewall at range 5100-5110.
|
||||
- PicBaseUrl=${ESHOP_AZURE_STORAGE_CATALOG_URL:-http://localhost:5202/c/api/v1/catalog/items/[0]/pic/} #Local: You need to open your local dev-machine firewall at range 5100-5110.
|
||||
- EventBusConnection=${ESHOP_AZURE_SERVICE_BUS:-rabbitmq}
|
||||
- EventBusUserName=${ESHOP_SERVICE_BUS_USERNAME}
|
||||
- EventBusPassword=${ESHOP_SERVICE_BUS_PASSWORD}
|
||||
|
Loading…
x
Reference in New Issue
Block a user