From 6c647587776e72ca1a5e770456c7f7b1d1ba2880 Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Wed, 4 Jan 2023 14:46:06 +0000 Subject: [PATCH] initial commit --- .gitignore | 5 +++++ AddressBookApi.csproj | 19 ++++++++++++++++ AddressBookApi.sln | 16 +++++++++++++ Program.cs | 25 +++++++++++++++++++++ Properties/launchSettings.json | 41 ++++++++++++++++++++++++++++++++++ appsettings.Development.json | 8 +++++++ appsettings.json | 9 ++++++++ 7 files changed, 123 insertions(+) create mode 100644 .gitignore create mode 100644 AddressBookApi.csproj create mode 100644 AddressBookApi.sln create mode 100644 Program.cs create mode 100644 Properties/launchSettings.json create mode 100644 appsettings.Development.json create mode 100644 appsettings.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/AddressBookApi.csproj b/AddressBookApi.csproj new file mode 100644 index 0000000..fe4dc41 --- /dev/null +++ b/AddressBookApi.csproj @@ -0,0 +1,19 @@ + + + + net7.0 + enable + enable + + + + + + + + + + + + + diff --git a/AddressBookApi.sln b/AddressBookApi.sln new file mode 100644 index 0000000..b4d8302 --- /dev/null +++ b/AddressBookApi.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddressBookApi", "AddressBookApi.csproj", "{1A01A987-3E73-4A01-984D-75634614B5B7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1A01A987-3E73-4A01-984D-75634614B5B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A01A987-3E73-4A01-984D-75634614B5B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A01A987-3E73-4A01-984D-75634614B5B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A01A987-3E73-4A01-984D-75634614B5B7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..8264bac --- /dev/null +++ b/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(); \ No newline at end of file diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json new file mode 100644 index 0000000..1f72753 --- /dev/null +++ b/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:47773", + "sslPort": 44329 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5254", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7061;http://localhost:5254", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/appsettings.Development.json b/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/appsettings.json b/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +}