From a2f11a70832452abc07b70697d946ebcb17dee25 Mon Sep 17 00:00:00 2001 From: TekH Date: Tue, 25 Nov 2025 00:25:51 +0100 Subject: [PATCH] Initialize ASP.NET Core Web API project Set up a new ASP.NET Core Web API project named `ReC.API` targeting .NET 8.0. - Added `ReC.sln` solution file with Debug and Release configurations. - Configured logging settings in `appsettings.json` and `appsettings.Development.json`. - Created `Program.cs` to bootstrap the application with controllers, Swagger, and middleware. - Defined project structure in `ReC.API.csproj`, including Swagger dependency and nullable reference types. - Added `launchSettings.json` with profiles for `http`, `https`, and `IIS Express`. --- ReC.API/Program.cs | 25 ++++++++++++++++ ReC.API/Properties/launchSettings.json | 41 ++++++++++++++++++++++++++ ReC.API/ReC.API.csproj | 17 +++++++++++ ReC.API/appsettings.Development.json | 8 +++++ ReC.API/appsettings.json | 9 ++++++ ReC.sln | 25 ++++++++++++++++ 6 files changed, 125 insertions(+) create mode 100644 ReC.API/Program.cs create mode 100644 ReC.API/Properties/launchSettings.json create mode 100644 ReC.API/ReC.API.csproj create mode 100644 ReC.API/appsettings.Development.json create mode 100644 ReC.API/appsettings.json create mode 100644 ReC.sln diff --git a/ReC.API/Program.cs b/ReC.API/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/ReC.API/Program.cs @@ -0,0 +1,25 @@ +var builder = WebApplication.CreateBuilder(args); + +// 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 app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseSwagger(); + app.UseSwaggerUI(); +} + +app.UseHttpsRedirection(); + +app.UseAuthorization(); + +app.MapControllers(); + +app.Run(); diff --git a/ReC.API/Properties/launchSettings.json b/ReC.API/Properties/launchSettings.json new file mode 100644 index 0000000..e4ea14f --- /dev/null +++ b/ReC.API/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:9130", + "sslPort": 44366 + } + }, + "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:7184;http://localhost:5055", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/ReC.API/ReC.API.csproj b/ReC.API/ReC.API.csproj new file mode 100644 index 0000000..0c56541 --- /dev/null +++ b/ReC.API/ReC.API.csproj @@ -0,0 +1,17 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + diff --git a/ReC.API/appsettings.Development.json b/ReC.API/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/ReC.API/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/ReC.API/appsettings.json b/ReC.API/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/ReC.API/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/ReC.sln b/ReC.sln new file mode 100644 index 0000000..be84d7f --- /dev/null +++ b/ReC.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36717.8 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReC.API", "ReC.API\ReC.API.csproj", "{420218AD-3C27-4003-9A84-36C92352F175}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {420218AD-3C27-4003-9A84-36C92352F175}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {420218AD-3C27-4003-9A84-36C92352F175}.Debug|Any CPU.Build.0 = Debug|Any CPU + {420218AD-3C27-4003-9A84-36C92352F175}.Release|Any CPU.ActiveCfg = Release|Any CPU + {420218AD-3C27-4003-9A84-36C92352F175}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F7B09104-4072-4635-9492-9C7C68D96ABD} + EndGlobalSection +EndGlobal