Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCera Samson <t-samsoncera@microsoft.com>2022-06-23 01:14:12 +0300
committerGitHub <noreply@github.com>2022-06-23 01:14:12 +0300
commit4bafffffa889c9a8dcfb47768b63c13fb074c22d (patch)
tree0fc68535057bd47e67b34db5300521233260d1cd /src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Server/Program.cs
parent7340c27b04f3f592a1eee2795a543129d0951805 (diff)
Empty Blazor WebAssembly Project Template (#42215)
* Duplicated required files * Removed authentication, pages, formatting * Fix namespaces * Remove readme / auth template options * Update Index.razor * Remove auth options from templatestrings * Update launchSettings.json * Remove auth (cont.), rename files * Added .csproj.in files * Update templatestrings.json * Update templatestrings.cs.json * Update Program.cs * Modify to reflect changes in http/https launch profiles * Add template test; remove RequiresHttps logic * Added blazorwasm-empty template baseline tests * Merge branch 'main' into t-samsoncera/empty-wasm * Changes from code review; fix failing test * Add empty file to Shared folder * Update src/ProjectTemplates/test/Templates.Blazor.Tests/EmptyBlazorWasmTemplateTest.cs Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Fix issues with launchBrowser and missing PWA install app * Update src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Server/Program.cs Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update EmptyComponentsWebAssembly-CSharp.sln * Fix missing Server project * Update .json files * Update template-baselines.json * Move icon.png into ide/ * Update ide.host.json * Fix template-baselines, template.json * Fix templates-baselines, remove icon-192.png * Revert "Fix templates-baselines, remove icon-192.png" This reverts commit fa76595cf5928dfcbff89d0b980f9051fde8d52e. * Delete icon-192.png * Update src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Client/wwwroot/manifest.json Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Add ExcludeLaunchSettings to template.json * Move tags into ide.host.json * Fix closing brace appsettings.json Caused /Server build to fail Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com>
Diffstat (limited to 'src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Server/Program.cs')
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Server/Program.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Server/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Server/Program.cs
new file mode 100644
index 0000000000..a8e63acaf0
--- /dev/null
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Server/Program.cs
@@ -0,0 +1,33 @@
+using Microsoft.AspNetCore.ResponseCompression;
+
+var builder = WebApplication.CreateBuilder(args);
+
+builder.Services.AddControllersWithViews();
+builder.Services.AddRazorPages();
+
+var app = builder.Build();
+
+// Configure the HTTP request pipeline.
+if (app.Environment.IsDevelopment())
+{
+ app.UseWebAssemblyDebugging();
+}
+#if (HasHttpsProfile)
+else
+{
+ // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
+ app.UseHsts();
+}
+
+app.UseHttpsRedirection();
+#endif
+app.UseBlazorFrameworkFiles();
+app.UseStaticFiles();
+
+app.UseRouting();
+
+app.MapRazorPages();
+app.MapControllers();
+app.MapFallbackToFile("index.html");
+
+app.Run();