From 02003806f71ab25f60849516df0678c034497209 Mon Sep 17 00:00:00 2001 From: Tino Hager Date: Sun, 24 Mar 2024 22:12:48 +0100 Subject: [PATCH] remove web api demo project move to own project --- .../Nager.PublicSuffix.WebApi.csproj | 19 ------ .../Nager.PublicSuffix.WebApi.http | 15 ----- src/Nager.PublicSuffix.WebApi/Program.cs | 59 ------------------- .../Properties/launchSettings.json | 15 ----- .../appsettings.Development.json | 8 --- .../appsettings.json | 14 ----- src/Nager.PublicSuffix.sln | 8 +-- 7 files changed, 1 insertion(+), 137 deletions(-) delete mode 100644 src/Nager.PublicSuffix.WebApi/Nager.PublicSuffix.WebApi.csproj delete mode 100644 src/Nager.PublicSuffix.WebApi/Nager.PublicSuffix.WebApi.http delete mode 100644 src/Nager.PublicSuffix.WebApi/Program.cs delete mode 100644 src/Nager.PublicSuffix.WebApi/Properties/launchSettings.json delete mode 100644 src/Nager.PublicSuffix.WebApi/appsettings.Development.json delete mode 100644 src/Nager.PublicSuffix.WebApi/appsettings.json diff --git a/src/Nager.PublicSuffix.WebApi/Nager.PublicSuffix.WebApi.csproj b/src/Nager.PublicSuffix.WebApi/Nager.PublicSuffix.WebApi.csproj deleted file mode 100644 index 410dfa0..0000000 --- a/src/Nager.PublicSuffix.WebApi/Nager.PublicSuffix.WebApi.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net8.0 - enable - enable - true - - - - - - - - - - - - diff --git a/src/Nager.PublicSuffix.WebApi/Nager.PublicSuffix.WebApi.http b/src/Nager.PublicSuffix.WebApi/Nager.PublicSuffix.WebApi.http deleted file mode 100644 index 5c4ebfa..0000000 --- a/src/Nager.PublicSuffix.WebApi/Nager.PublicSuffix.WebApi.http +++ /dev/null @@ -1,15 +0,0 @@ -@Nager.PublicSuffix.WebApi_HostAddress = http://localhost:5096 - -GET {{Nager.PublicSuffix.WebApi_HostAddress}}/DomainInfo/test.de/ -Accept: application/json -### - -GET {{Nager.PublicSuffix.WebApi_HostAddress}}/DomainInfo/mail.test.de/ -Accept: application/json - -### - -GET {{Nager.PublicSuffix.WebApi_HostAddress}}/DomainInfo/s3-1.amazonaws.com/ -Accept: application/json - -### diff --git a/src/Nager.PublicSuffix.WebApi/Program.cs b/src/Nager.PublicSuffix.WebApi/Program.cs deleted file mode 100644 index 1c07b37..0000000 --- a/src/Nager.PublicSuffix.WebApi/Program.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Nager.PublicSuffix; -using Nager.PublicSuffix.RuleProviders; -using Nager.PublicSuffix.RuleProviders.CacheProviders; -using System.Text.Json.Serialization; -using System.Web; - -var builder = WebApplication.CreateBuilder(args); - -// Add services to the container. - -builder.Services.AddHttpClient(); -builder.Services.AddSingleton(); -builder.Services.AddSingleton(); -builder.Services.AddSingleton(); - -// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); - -builder.Services.Configure(opt => -{ - opt.SerializerOptions.Converters.Add(new JsonStringEnumConverter()); -}); - -var app = builder.Build(); - -var ruleProvider = app.Services.GetService(); -if (ruleProvider != null) -{ - await ruleProvider.BuildAsync(); -} - -// Configure the HTTP request pipeline. -if (app.Environment.IsDevelopment()) -{ - app.UseSwagger(); - app.UseSwaggerUI(); -} - -app.MapGet("/DomainInfo/{domain}", (string domain, IDomainParser domainParser) => -{ - domain = HttpUtility.UrlEncode(domain); - - var domainInfo = domainParser.Parse(domain); - return domainInfo; -}) -.WithName("DomainInfo") -.WithOpenApi(); - -app.MapPost("/UpdateRules", async (IRuleProvider ruleProvider) => -{ - await ruleProvider.BuildAsync(ignoreCache: true); - return Results.NoContent(); -}) -.WithName("UpdateRules") -.WithOpenApi(); - -app.Run(); - diff --git a/src/Nager.PublicSuffix.WebApi/Properties/launchSettings.json b/src/Nager.PublicSuffix.WebApi/Properties/launchSettings.json deleted file mode 100644 index bc8cb9a..0000000 --- a/src/Nager.PublicSuffix.WebApi/Properties/launchSettings.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "profiles": { - "http": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "dotnetRunMessages": true, - "applicationUrl": "http://localhost:5096" - } - }, - "$schema": "http://json.schemastore.org/launchsettings.json" -} \ No newline at end of file diff --git a/src/Nager.PublicSuffix.WebApi/appsettings.Development.json b/src/Nager.PublicSuffix.WebApi/appsettings.Development.json deleted file mode 100644 index 0c208ae..0000000 --- a/src/Nager.PublicSuffix.WebApi/appsettings.Development.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - } -} diff --git a/src/Nager.PublicSuffix.WebApi/appsettings.json b/src/Nager.PublicSuffix.WebApi/appsettings.json deleted file mode 100644 index 6c821be..0000000 --- a/src/Nager.PublicSuffix.WebApi/appsettings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*", - "Nager": { - "PublicSuffix": { - "DataUrl": "https://publicsuffix.org/list/public_suffix_list.dat" - } - } -} diff --git a/src/Nager.PublicSuffix.sln b/src/Nager.PublicSuffix.sln index cdc321b..1b969b7 100644 --- a/src/Nager.PublicSuffix.sln +++ b/src/Nager.PublicSuffix.sln @@ -7,9 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nager.PublicSuffix", "Nager EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nager.PublicSuffix.UnitTest", "Nager.PublicSuffix.UnitTest\Nager.PublicSuffix.UnitTest.csproj", "{09196C00-837C-4980-AF04-3F7B3ED8049C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nager.PublicSuffix.WebApi", "Nager.PublicSuffix.WebApi\Nager.PublicSuffix.WebApi.csproj", "{C11F3A04-C675-493F-9F9A-5CC0EB5AB231}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nager.PublicSuffix.TestConsole", "Nager.PublicSuffix.TestConsole\Nager.PublicSuffix.TestConsole.csproj", "{E0D96585-D51D-43EF-AFA2-035480D596E8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nager.PublicSuffix.TestConsole", "Nager.PublicSuffix.TestConsole\Nager.PublicSuffix.TestConsole.csproj", "{E0D96585-D51D-43EF-AFA2-035480D596E8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -25,10 +23,6 @@ Global {09196C00-837C-4980-AF04-3F7B3ED8049C}.Debug|Any CPU.Build.0 = Debug|Any CPU {09196C00-837C-4980-AF04-3F7B3ED8049C}.Release|Any CPU.ActiveCfg = Release|Any CPU {09196C00-837C-4980-AF04-3F7B3ED8049C}.Release|Any CPU.Build.0 = Release|Any CPU - {C11F3A04-C675-493F-9F9A-5CC0EB5AB231}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C11F3A04-C675-493F-9F9A-5CC0EB5AB231}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C11F3A04-C675-493F-9F9A-5CC0EB5AB231}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C11F3A04-C675-493F-9F9A-5CC0EB5AB231}.Release|Any CPU.Build.0 = Release|Any CPU {E0D96585-D51D-43EF-AFA2-035480D596E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E0D96585-D51D-43EF-AFA2-035480D596E8}.Debug|Any CPU.Build.0 = Debug|Any CPU {E0D96585-D51D-43EF-AFA2-035480D596E8}.Release|Any CPU.ActiveCfg = Release|Any CPU