diff --git a/DysonNetwork.Control/AppHost.cs b/DysonNetwork.Control/AppHost.cs index a431e7ce..36ca30f6 100644 --- a/DysonNetwork.Control/AppHost.cs +++ b/DysonNetwork.Control/AppHost.cs @@ -1,30 +1,53 @@ +using Aspire.Hosting.Yarp.Transforms; + var builder = DistributedApplication.CreateBuilder(args); var database = builder.AddPostgres("database"); var cache = builder.AddConnectionString("cache"); var queue = builder.AddNats("queue").WithJetStream(); -var ring = builder.AddProject("ring") +var ringService = builder.AddProject("ring") .WithReference(database) .WithReference(queue); -var pass = builder.AddProject("pass") +var passService = builder.AddProject("pass") .WithReference(database) .WithReference(cache) .WithReference(queue) - .WithReference(ring); -builder.AddProject("drive") + .WithReference(ringService); +var driveService = builder.AddProject("drive") .WithReference(database) .WithReference(cache) .WithReference(queue) - .WithReference(pass); -builder.AddProject("sphere") + .WithReference(passService); +var sphereService = builder.AddProject("sphere") .WithReference(database) .WithReference(cache) .WithReference(queue) - .WithReference(pass); -builder.AddProject("develop") + .WithReference(passService); +var developService = builder.AddProject("develop") .WithReference(database) .WithReference(cache) - .WithReference(pass); + .WithReference(passService); + +var gateway = builder.AddYarp("gateway") + .WithHostPort(5000) + .WithConfiguration(yarp => + { + yarp.AddRoute("/ring/{**catch-all}", ringService) + .WithTransformPathRemovePrefix("/ring") + .WithTransformPathPrefix("/api"); + yarp.AddRoute("/id/{**catch-all}", passService) + .WithTransformPathRemovePrefix("/id") + .WithTransformPathPrefix("/api"); + yarp.AddRoute("/drive/{**catch-all}", driveService) + .WithTransformPathRemovePrefix("/drive") + .WithTransformPathPrefix("/api"); + yarp.AddRoute("/sphere/{**catch-all}", sphereService) + .WithTransformPathRemovePrefix("/sphere") + .WithTransformPathPrefix("/api"); + yarp.AddRoute("/develop/{**catch-all}", developService) + .WithTransformPathRemovePrefix("/develop") + .WithTransformPathPrefix("/api"); + }); builder.Build().Run(); \ No newline at end of file diff --git a/DysonNetwork.Control/DysonNetwork.Control.csproj b/DysonNetwork.Control/DysonNetwork.Control.csproj index ed476233..7ca99c25 100644 --- a/DysonNetwork.Control/DysonNetwork.Control.csproj +++ b/DysonNetwork.Control/DysonNetwork.Control.csproj @@ -15,6 +15,7 @@ + diff --git a/DysonNetwork.Develop/Properties/launchSettings.json b/DysonNetwork.Develop/Properties/launchSettings.json index 32476e38..92cb95a2 100644 --- a/DysonNetwork.Develop/Properties/launchSettings.json +++ b/DysonNetwork.Develop/Properties/launchSettings.json @@ -9,15 +9,6 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } - }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "https://localhost:7192;http://localhost:5156", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } } } } diff --git a/DysonNetwork.Drive/Properties/launchSettings.json b/DysonNetwork.Drive/Properties/launchSettings.json index d4fe22bd..3e3be25a 100644 --- a/DysonNetwork.Drive/Properties/launchSettings.json +++ b/DysonNetwork.Drive/Properties/launchSettings.json @@ -9,15 +9,6 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } - }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "https://localhost:7092;http://localhost:5090", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } } } } diff --git a/DysonNetwork.Pass/Properties/launchSettings.json b/DysonNetwork.Pass/Properties/launchSettings.json index 23c7313d..cf67092c 100644 --- a/DysonNetwork.Pass/Properties/launchSettings.json +++ b/DysonNetwork.Pass/Properties/launchSettings.json @@ -9,15 +9,6 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } - }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "https://localhost:7058;http://localhost:5216", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } } } } diff --git a/DysonNetwork.Ring/Properties/launchSettings.json b/DysonNetwork.Ring/Properties/launchSettings.json index 982a3669..c0f253c3 100644 --- a/DysonNetwork.Ring/Properties/launchSettings.json +++ b/DysonNetwork.Ring/Properties/launchSettings.json @@ -9,15 +9,6 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } - }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "https://localhost:7259;http://localhost:5212", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } } } } diff --git a/DysonNetwork.ServiceDefaults/Extensions.cs b/DysonNetwork.ServiceDefaults/Extensions.cs index 2a1ded04..fbd16087 100644 --- a/DysonNetwork.ServiceDefaults/Extensions.cs +++ b/DysonNetwork.ServiceDefaults/Extensions.cs @@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.ServiceDiscovery; using OpenTelemetry; using OpenTelemetry.Metrics; using OpenTelemetry.Trace; @@ -36,13 +35,16 @@ public static class Extensions }); // Uncomment the following to restrict the allowed schemes for service discovery. - builder.Services.Configure(options => - { - options.AllowedSchemes = ["https"]; - }); + // builder.Services.Configure(options => + // { + // options.AllowedSchemes = ["https"]; + // }); builder.AddNatsClient("queue"); - builder.AddRedisClient("cache"); + builder.AddRedisClient("cache", configureOptions: opts => + { + opts.AbortOnConnectFail = false; + }); return builder; } diff --git a/DysonNetwork.Sphere/Properties/launchSettings.json b/DysonNetwork.Sphere/Properties/launchSettings.json index a6ab6aaa..01139403 100644 --- a/DysonNetwork.Sphere/Properties/launchSettings.json +++ b/DysonNetwork.Sphere/Properties/launchSettings.json @@ -9,15 +9,6 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } - }, - "https": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "https://localhost:7099;http://localhost:5071", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } } } } diff --git a/DysonNetwork.sln.DotSettings.user b/DysonNetwork.sln.DotSettings.user index 572c9cc3..ee7b1ceb 100644 --- a/DysonNetwork.sln.DotSettings.user +++ b/DysonNetwork.sln.DotSettings.user @@ -35,6 +35,7 @@ ForceIncluded ForceIncluded ForceIncluded + ForceIncluded ForceIncluded ForceIncluded ForceIncluded @@ -82,6 +83,7 @@ ForceIncluded ForceIncluded ForceIncluded + ForceIncluded ForceIncluded ForceIncluded ForceIncluded