diff --git a/SampleWebApp.Core/Program.cs b/SampleWebApp.Core/Program.cs new file mode 100644 index 0000000..ed90792 --- /dev/null +++ b/SampleWebApp.Core/Program.cs @@ -0,0 +1,24 @@ +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddControllersWithViews(); + +var app = builder.Build(); + +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); +} + +app.UseHttpsRedirection(); +app.UseStaticFiles(); + +app.UseRouting(); + +app.UseAuthorization(); + +app.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + +app.Run(); diff --git a/SampleWebApp.Core/Properties/launchSettings.json b/SampleWebApp.Core/Properties/launchSettings.json new file mode 100644 index 0000000..1136d32 --- /dev/null +++ b/SampleWebApp.Core/Properties/launchSettings.json @@ -0,0 +1,37 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50624", + "sslPort": 44301 + } + }, + "profiles": { + "SampleWebApp.Core": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7001;http://localhost:5001", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Staging": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7002;http://localhost:5002", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Staging" + } + } + } +} diff --git a/SampleWebApp.Core/SampleWebApp.Core.csproj b/SampleWebApp.Core/SampleWebApp.Core.csproj new file mode 100644 index 0000000..34b0ce1 --- /dev/null +++ b/SampleWebApp.Core/SampleWebApp.Core.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/SampleWebApp.Core/appsettings.Development.json b/SampleWebApp.Core/appsettings.Development.json new file mode 100644 index 0000000..40f74d1 --- /dev/null +++ b/SampleWebApp.Core/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "HostTypeString": "LocalHost" +} diff --git a/SampleWebApp.Core/appsettings.Production.json b/SampleWebApp.Core/appsettings.Production.json new file mode 100644 index 0000000..d443bd5 --- /dev/null +++ b/SampleWebApp.Core/appsettings.Production.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning", + "Microsoft.AspNetCore": "Error" + } + }, + "HostTypeString": "Production" +} diff --git a/SampleWebApp.Core/appsettings.Staging.json b/SampleWebApp.Core/appsettings.Staging.json new file mode 100644 index 0000000..4daa791 --- /dev/null +++ b/SampleWebApp.Core/appsettings.Staging.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning", + "Microsoft.AspNetCore": "Warning" + } + }, + "HostTypeString": "Staging" +} diff --git a/SampleWebApp.Core/appsettings.json b/SampleWebApp.Core/appsettings.json new file mode 100644 index 0000000..6070563 --- /dev/null +++ b/SampleWebApp.Core/appsettings.json @@ -0,0 +1,14 @@ +{ + "ConnectionStrings": { + "SampleWebAppDb": "Data Source=(localdb)\\mssqllocaldb;Initial Catalog=SampleWebAppDb;MultipleActiveResultSets=True;Integrated Security=SSPI;Trusted_Connection=True" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "HostTypeString": "LocalHost", + "DatabaseLoginPrefix": "jonsmith_" +} diff --git a/SampleWebApp.sln b/SampleWebApp.sln index b474189..fb6826e 100644 --- a/SampleWebApp.sln +++ b/SampleWebApp.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceLayer", "ServiceLaye EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{6D9E7904-B2AC-49E3-83A7-6B48876F46B9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleWebApp.Core", "SampleWebApp.Core\SampleWebApp.Core.csproj", "{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AF8764F7-FBEE-48AD-AF62-23010DA35D70}" ProjectSection(SolutionItems) = preProject Licence.txt = Licence.txt @@ -56,6 +58,14 @@ Global {6D9E7904-B2AC-49E3-83A7-6B48876F46B9}.Release|Any CPU.ActiveCfg = Release|Any CPU {6D9E7904-B2AC-49E3-83A7-6B48876F46B9}.Release|Any CPU.Build.0 = Release|Any CPU {6D9E7904-B2AC-49E3-83A7-6B48876F46B9}.WebWizRelease|Any CPU.ActiveCfg = WebWizRelease|Any CPU + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.AzureRelease|Any CPU.ActiveCfg = Release|Any CPU + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.AzureRelease|Any CPU.Build.0 = Release|Any CPU + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|Any CPU.Build.0 = Release|Any CPU + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.WebWizRelease|Any CPU.ActiveCfg = Release|Any CPU + {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.WebWizRelease|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE