diff --git a/DigitalData.Gateway.csproj b/DigitalData.Gateway.csproj new file mode 100644 index 0000000..fe6f447 --- /dev/null +++ b/DigitalData.Gateway.csproj @@ -0,0 +1,16 @@ + + + + net7.0 + enable + enable + 1.0.0 + 1.0.0 + 1.0.0 + + + + + + + diff --git a/DigitalData.Gateway.sln b/DigitalData.Gateway.sln new file mode 100644 index 0000000..7431dd5 --- /dev/null +++ b/DigitalData.Gateway.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33516.290 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.Gateway", "DigitalData.Gateway.csproj", "{329F45BF-4C79-4A7B-9086-D6205617AA42}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {329F45BF-4C79-4A7B-9086-D6205617AA42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {329F45BF-4C79-4A7B-9086-D6205617AA42}.Debug|Any CPU.Build.0 = Debug|Any CPU + {329F45BF-4C79-4A7B-9086-D6205617AA42}.Release|Any CPU.ActiveCfg = Release|Any CPU + {329F45BF-4C79-4A7B-9086-D6205617AA42}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {54236E11-D1EF-4FEE-A572-EB19134EE991} + EndGlobalSection +EndGlobal diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..de45f16 --- /dev/null +++ b/Program.cs @@ -0,0 +1,26 @@ +using Ocelot.DependencyInjection; +using Ocelot.Middleware; + +var builder = WebApplication.CreateBuilder(args); + +// Make sure to add the Ocelot configuration file +builder.Configuration.AddJsonFile("ocelot.json"); + +// Add Ocelot services +builder.Services.AddOcelot(); + +var app = builder.Build(); + +app.UseHttpsRedirection(); +app.UseRouting(); +app.UseAuthorization(); + +// Use Ocelot middleware in an appropriate way +app.UseEndpoints(endpoints => +{ + endpoints.MapControllers(); +}); + +app.UseOcelot().Wait(); + +app.Run(); diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json new file mode 100644 index 0000000..13f3425 --- /dev/null +++ b/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:19172", + "sslPort": 44316 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "usermanagerservice", + "applicationUrl": "http://localhost:5028", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7052;http://localhost:5028", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/appsettings.Development.json b/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/appsettings.json b/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/ocelot.json b/ocelot.json new file mode 100644 index 0000000..9f0c453 --- /dev/null +++ b/ocelot.json @@ -0,0 +1,19 @@ +{ + "Routes": [ + { + "DownstreamPathTemplate": "/swagger/index.html", + "DownstreamScheme": "https", + "DownstreamHostAndPorts": [ + { + "Host": "localhost", + "Port": 7192 + } + ], + "UpstreamPathTemplate": "/auth-swagger", + "UpstreamHttpMethod": [ "Get" ] + } + ], + "GlobalConfiguration": { + "BaseUrl": "https://localhost:7052" + } +} \ No newline at end of file