fix: Lösung in den Stammordner verschoben
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
namespace DigitalData.Swagger.Proxy.Configs
|
||||
{
|
||||
public class OriginServerParams
|
||||
{
|
||||
public required string Url { get; init; }
|
||||
|
||||
public Dictionary<string, string>? Headers { get; init; }
|
||||
}
|
||||
}
|
||||
13
src/DigitalData.Swagger.Proxy/Controllers/MetaController.cs
Normal file
13
src/DigitalData.Swagger.Proxy/Controllers/MetaController.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using DigitalData.Swagger.Proxy.Configs;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace DigitalData.Swagger.Proxy.Controllers;
|
||||
|
||||
[Route("[controller]")]
|
||||
[ApiController]
|
||||
public class MetaController(IOptions<OriginServerParams> originServerParamsoptions) : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
public IActionResult GetOriginServerParams() => Ok(originServerParamsoptions.Value);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
31
src/DigitalData.Swagger.Proxy/Program.cs
Normal file
31
src/DigitalData.Swagger.Proxy/Program.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using DigitalData.Swagger.Proxy.Configs;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var config = builder.Configuration;
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
var originServerSection = config.GetRequiredSection("OriginServer")
|
||||
?? throw new InvalidOperationException("The 'OriginServer' section is missing or incorrectly configured in the application configuration.");
|
||||
|
||||
builder.Services.Configure<OriginServerParams>(originServerSection);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// use swagger in production
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
41
src/DigitalData.Swagger.Proxy/Properties/launchSettings.json
Normal file
41
src/DigitalData.Swagger.Proxy/Properties/launchSettings.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:60947",
|
||||
"sslPort": 44357
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:5082",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:7121;http://localhost:5082",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
9
src/DigitalData.Swagger.Proxy/appsettings.json
Normal file
9
src/DigitalData.Swagger.Proxy/appsettings.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
Reference in New Issue
Block a user