From 967dd600fe0df3fd6c6da90733c557cb8e4651a8 Mon Sep 17 00:00:00 2001 From: "jason.zhu" Date: Tue, 20 Apr 2021 14:01:15 +0000 Subject: [PATCH] Created new web project DutchTreat --- .devcontainer/Dockerfile | 4 +-- DutchTreat.sln | 34 +++++++++++++++++++ DutchTreat/DutchTreat.csproj | 7 ++++ DutchTreat/Program.cs | 26 +++++++++++++++ DutchTreat/Properties/launchSettings.json | 28 ++++++++++++++++ DutchTreat/Startup.cs | 40 +++++++++++++++++++++++ DutchTreat/appsettings.Development.json | 9 +++++ DutchTreat/appsettings.json | 10 ++++++ 8 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 DutchTreat.sln create mode 100644 DutchTreat/DutchTreat.csproj create mode 100644 DutchTreat/Program.cs create mode 100644 DutchTreat/Properties/launchSettings.json create mode 100644 DutchTreat/Startup.cs create mode 100644 DutchTreat/appsettings.Development.json create mode 100644 DutchTreat/appsettings.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ef22cad..98ebe3d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -16,8 +16,8 @@ RUN if [ "$INSTALL_AZURE_CLI" = "true" ]; then bash /tmp/library-scripts/azcli-d && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts # [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends tree # [Optional] Uncomment this line to install global node packages. # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file diff --git a/DutchTreat.sln b/DutchTreat.sln new file mode 100644 index 0000000..5db80b8 --- /dev/null +++ b/DutchTreat.sln @@ -0,0 +1,34 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DutchTreat", "DutchTreat\DutchTreat.csproj", "{D0E1E2B2-43F4-48AA-A2A0-95247A577D48}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Debug|x64.ActiveCfg = Debug|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Debug|x64.Build.0 = Debug|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Debug|x86.ActiveCfg = Debug|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Debug|x86.Build.0 = Debug|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Release|Any CPU.Build.0 = Release|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Release|x64.ActiveCfg = Release|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Release|x64.Build.0 = Release|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Release|x86.ActiveCfg = Release|Any CPU + {D0E1E2B2-43F4-48AA-A2A0-95247A577D48}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/DutchTreat/DutchTreat.csproj b/DutchTreat/DutchTreat.csproj new file mode 100644 index 0000000..9c9eaf6 --- /dev/null +++ b/DutchTreat/DutchTreat.csproj @@ -0,0 +1,7 @@ + + + + net5.0 + + + diff --git a/DutchTreat/Program.cs b/DutchTreat/Program.cs new file mode 100644 index 0000000..88d0a01 --- /dev/null +++ b/DutchTreat/Program.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +namespace DutchTreat +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/DutchTreat/Properties/launchSettings.json b/DutchTreat/Properties/launchSettings.json new file mode 100644 index 0000000..5a35c97 --- /dev/null +++ b/DutchTreat/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:21491", + "sslPort": 44365 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "DutchTreat": { + "commandName": "Project", + "dotnetRunMessages": "true", + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/DutchTreat/Startup.cs b/DutchTreat/Startup.cs new file mode 100644 index 0000000..cef7c1c --- /dev/null +++ b/DutchTreat/Startup.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace DutchTreat +{ + public class Startup + { + // This method gets called by the runtime. Use this method to add services to the container. + // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 + public void ConfigureServices(IServiceCollection services) + { + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseRouting(); + + app.UseEndpoints(endpoints => + { + endpoints.MapGet("/", async context => + { + await context.Response.WriteAsync("Hello World!"); + }); + }); + } + } +} diff --git a/DutchTreat/appsettings.Development.json b/DutchTreat/appsettings.Development.json new file mode 100644 index 0000000..dba68eb --- /dev/null +++ b/DutchTreat/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + } +} diff --git a/DutchTreat/appsettings.json b/DutchTreat/appsettings.json new file mode 100644 index 0000000..81ff877 --- /dev/null +++ b/DutchTreat/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +}