From bb47f47ebd37061f36949b6c89ca0a6ccaf6968a Mon Sep 17 00:00:00 2001 From: dimazhelovanov Date: Tue, 11 Apr 2023 23:50:17 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=BD=D0=B8=D1=86=D0=B8=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TaskTrackerRestAPI/TaskTrackerRestAPI.sln | 25 +++++++++++++++ .../TaskTrackerRestAPI/Program.cs | 25 +++++++++++++++ .../Properties/launchSettings.json | 31 +++++++++++++++++++ .../TaskTrackerRestAPI.csproj | 13 ++++++++ .../TaskTrackerRestAPI/WeatherForecast.cs | 13 ++++++++ .../appsettings.Development.json | 8 +++++ .../TaskTrackerRestAPI/appsettings.json | 9 ++++++ 7 files changed, 124 insertions(+) create mode 100644 TaskTrackerRestAPI/TaskTrackerRestAPI.sln create mode 100644 TaskTrackerRestAPI/TaskTrackerRestAPI/Program.cs create mode 100644 TaskTrackerRestAPI/TaskTrackerRestAPI/Properties/launchSettings.json create mode 100644 TaskTrackerRestAPI/TaskTrackerRestAPI/TaskTrackerRestAPI.csproj create mode 100644 TaskTrackerRestAPI/TaskTrackerRestAPI/WeatherForecast.cs create mode 100644 TaskTrackerRestAPI/TaskTrackerRestAPI/appsettings.Development.json create mode 100644 TaskTrackerRestAPI/TaskTrackerRestAPI/appsettings.json diff --git a/TaskTrackerRestAPI/TaskTrackerRestAPI.sln b/TaskTrackerRestAPI/TaskTrackerRestAPI.sln new file mode 100644 index 0000000..ee590d8 --- /dev/null +++ b/TaskTrackerRestAPI/TaskTrackerRestAPI.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33424.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TaskTrackerRestAPI", "TaskTrackerRestAPI\TaskTrackerRestAPI.csproj", "{6E99CB02-F2E8-48D2-B6B8-25E23C20AD55}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6E99CB02-F2E8-48D2-B6B8-25E23C20AD55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E99CB02-F2E8-48D2-B6B8-25E23C20AD55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E99CB02-F2E8-48D2-B6B8-25E23C20AD55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E99CB02-F2E8-48D2-B6B8-25E23C20AD55}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D5354E1A-D348-4561-B90F-7C94301F9718} + EndGlobalSection +EndGlobal diff --git a/TaskTrackerRestAPI/TaskTrackerRestAPI/Program.cs b/TaskTrackerRestAPI/TaskTrackerRestAPI/Program.cs new file mode 100644 index 0000000..d7a851e --- /dev/null +++ b/TaskTrackerRestAPI/TaskTrackerRestAPI/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/TaskTrackerRestAPI/TaskTrackerRestAPI/Properties/launchSettings.json b/TaskTrackerRestAPI/TaskTrackerRestAPI/Properties/launchSettings.json new file mode 100644 index 0000000..d488617 --- /dev/null +++ b/TaskTrackerRestAPI/TaskTrackerRestAPI/Properties/launchSettings.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:49639", + "sslPort": 44337 + } + }, + "profiles": { + "TaskTrackerRestAPI": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7184;http://localhost:5174", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/TaskTrackerRestAPI/TaskTrackerRestAPI/TaskTrackerRestAPI.csproj b/TaskTrackerRestAPI/TaskTrackerRestAPI/TaskTrackerRestAPI.csproj new file mode 100644 index 0000000..60bf9ea --- /dev/null +++ b/TaskTrackerRestAPI/TaskTrackerRestAPI/TaskTrackerRestAPI.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/TaskTrackerRestAPI/TaskTrackerRestAPI/WeatherForecast.cs b/TaskTrackerRestAPI/TaskTrackerRestAPI/WeatherForecast.cs new file mode 100644 index 0000000..8f8678f --- /dev/null +++ b/TaskTrackerRestAPI/TaskTrackerRestAPI/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace TaskTrackerRestAPI +{ + public class WeatherForecast + { + public DateTime Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} \ No newline at end of file diff --git a/TaskTrackerRestAPI/TaskTrackerRestAPI/appsettings.Development.json b/TaskTrackerRestAPI/TaskTrackerRestAPI/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/TaskTrackerRestAPI/TaskTrackerRestAPI/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/TaskTrackerRestAPI/TaskTrackerRestAPI/appsettings.json b/TaskTrackerRestAPI/TaskTrackerRestAPI/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/TaskTrackerRestAPI/TaskTrackerRestAPI/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}