diff --git a/DigitalData.Swagger.sln b/DigitalData.Swagger.sln index c271bd2..ee3c100 100644 --- a/DigitalData.Swagger.sln +++ b/DigitalData.Swagger.sln @@ -7,6 +7,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalData.Swagger.Proxy", EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C5ED9B8C-5A36-440E-BF25-8FB0EC870924}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.Swagger.MockAPI", "src\DigitalData.Swagger.MockAPI\DigitalData.Swagger.MockAPI.csproj", "{1D229E96-67BC-4717-B6E6-60A067BC498E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -17,12 +19,17 @@ Global {2CC25C4F-147E-4A64-9EA9-51C00BC7430E}.Debug|Any CPU.Build.0 = Debug|Any CPU {2CC25C4F-147E-4A64-9EA9-51C00BC7430E}.Release|Any CPU.ActiveCfg = Release|Any CPU {2CC25C4F-147E-4A64-9EA9-51C00BC7430E}.Release|Any CPU.Build.0 = Release|Any CPU + {1D229E96-67BC-4717-B6E6-60A067BC498E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1D229E96-67BC-4717-B6E6-60A067BC498E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1D229E96-67BC-4717-B6E6-60A067BC498E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1D229E96-67BC-4717-B6E6-60A067BC498E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {2CC25C4F-147E-4A64-9EA9-51C00BC7430E} = {C5ED9B8C-5A36-440E-BF25-8FB0EC870924} + {1D229E96-67BC-4717-B6E6-60A067BC498E} = {C5ED9B8C-5A36-440E-BF25-8FB0EC870924} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {071BB599-BE8A-4680-A008-35B0357D4899} diff --git a/src/DigitalData.Swagger.MockAPI/DigitalData.Swagger.MockAPI.csproj b/src/DigitalData.Swagger.MockAPI/DigitalData.Swagger.MockAPI.csproj new file mode 100644 index 0000000..af1efcb --- /dev/null +++ b/src/DigitalData.Swagger.MockAPI/DigitalData.Swagger.MockAPI.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + diff --git a/src/DigitalData.Swagger.MockAPI/DigitalData.Swagger.MockAPI.http b/src/DigitalData.Swagger.MockAPI/DigitalData.Swagger.MockAPI.http new file mode 100644 index 0000000..4acbc6a --- /dev/null +++ b/src/DigitalData.Swagger.MockAPI/DigitalData.Swagger.MockAPI.http @@ -0,0 +1,6 @@ +@DigitalData.Swagger.MockAPI_HostAddress = http://localhost:5055 + +GET {{DigitalData.Swagger.MockAPI_HostAddress}}/weatherforecast/ +Accept: application/json + +### diff --git a/src/DigitalData.Swagger.MockAPI/Program.cs b/src/DigitalData.Swagger.MockAPI/Program.cs new file mode 100644 index 0000000..56a1cc4 --- /dev/null +++ b/src/DigitalData.Swagger.MockAPI/Program.cs @@ -0,0 +1,26 @@ +var builder = WebApplication.CreateBuilder(args); +var config = builder.Configuration; + +// Add services to the container. + +builder.Services.AddControllers(); + +builder.Services.AddEndpointsApiExplorer(); +builder.Services.AddSwaggerGen(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (config.GetValue("UseSwagger")) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/src/DigitalData.Swagger.MockAPI/Properties/launchSettings.json b/src/DigitalData.Swagger.MockAPI/Properties/launchSettings.json new file mode 100644 index 0000000..a6a6e7d --- /dev/null +++ b/src/DigitalData.Swagger.MockAPI/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:53791", + "sslPort": 44384 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5055", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7248;http://localhost:5055", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/DigitalData.Swagger.MockAPI/appsettings.Development.json b/src/DigitalData.Swagger.MockAPI/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/src/DigitalData.Swagger.MockAPI/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/src/DigitalData.Swagger.MockAPI/appsettings.json b/src/DigitalData.Swagger.MockAPI/appsettings.json new file mode 100644 index 0000000..3df636b --- /dev/null +++ b/src/DigitalData.Swagger.MockAPI/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "UseSwagger": true +}