From 582eb9f2b4fc515d76cfb74560639959c6f27c65 Mon Sep 17 00:00:00 2001 From: Melvin Lee Date: Thu, 12 Oct 2023 11:46:08 +0200 Subject: [PATCH] chore(proxy): ocelot dev configuratie toegevoegd --- src/Woz.BevragenProxy/Program.cs | 10 ++++------ .../config/ocelot.Development.json | 16 ++++++++++++++++ src/Woz.BevragenProxy/config/ocelot.json | 8 ++++---- 3 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 src/Woz.BevragenProxy/config/ocelot.Development.json diff --git a/src/Woz.BevragenProxy/Program.cs b/src/Woz.BevragenProxy/Program.cs index 704ca06..fd33d4f 100644 --- a/src/Woz.BevragenProxy/Program.cs +++ b/src/Woz.BevragenProxy/Program.cs @@ -1,11 +1,7 @@ +using System.IO; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Woz.BevragenProxy { @@ -20,7 +16,9 @@ public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureAppConfiguration((hostBuilderContext, configBuilder) => { - configBuilder.AddJsonFile("config/ocelot.json"); + configBuilder.AddJsonFile(Path.Combine("config", "ocelot.json")) + .AddJsonFile(Path.Combine("config", $"ocelot.{hostBuilderContext.HostingEnvironment.EnvironmentName}.json"), true) + .AddEnvironmentVariables(); }) .ConfigureWebHostDefaults(webBuilder => { diff --git a/src/Woz.BevragenProxy/config/ocelot.Development.json b/src/Woz.BevragenProxy/config/ocelot.Development.json new file mode 100644 index 0000000..7f74f34 --- /dev/null +++ b/src/Woz.BevragenProxy/config/ocelot.Development.json @@ -0,0 +1,16 @@ +{ + "Routes": [ + { + "UpstreamPathTemplate": "/lvwoz-eto/huidigebevragingen/{everything}", + "DownstreamPathTemplate": "/lvwoz-eto/huidigebevragingen/{everything}", + "DownstreamScheme": "http", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": "5010" + } + ] + } + ] + } + \ No newline at end of file diff --git a/src/Woz.BevragenProxy/config/ocelot.json b/src/Woz.BevragenProxy/config/ocelot.json index ff412b3..4a16cb7 100644 --- a/src/Woz.BevragenProxy/config/ocelot.json +++ b/src/Woz.BevragenProxy/config/ocelot.json @@ -1,13 +1,13 @@ { "Routes": [ { - "UpstreamPathTemplate": "/{everything}", + "UpstreamPathTemplate": "/lvwoz-eto/huidigebevragingen/{everything}", "DownstreamPathTemplate": "/lvwoz-eto/huidigebevragingen/{everything}", - "DownstreamScheme": "https", + "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { - "Host": "api.kadaster.nl", - "Port": "443" + "Host": "wozbevragenmock", + "Port": "5010" } ], "UpstreamHeaderTransform": {