aboutsummaryrefslogtreecommitdiff
path: root/Web/Startup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Web/Startup.cs')
-rw-r--r--Web/Startup.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/Web/Startup.cs b/Web/Startup.cs
index 51a6797..b72eb44 100644
--- a/Web/Startup.cs
+++ b/Web/Startup.cs
@@ -3,11 +3,13 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using Web.Data;
namespace Web
{
@@ -21,9 +23,12 @@ namespace Web
public IConfiguration Configuration { get; }
// 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)
{
- services.AddControllersWithViews();
+ services.AddRazorPages();
+ services.AddServerSideBlazor();
+ services.AddSingleton<WeatherForecastService>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -35,22 +40,20 @@ namespace Web
}
else
{
- app.UseExceptionHandler("/Home/Error");
+ app.UseExceptionHandler("/Error");
// 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();
app.UseStaticFiles();
app.UseRouting();
- app.UseAuthorization();
-
app.UseEndpoints(endpoints =>
{
- endpoints.MapControllerRoute(
- name: "default",
- pattern: "{controller=Home}/{action=Index}/{id?}");
+ endpoints.MapBlazorHub();
+ endpoints.MapFallbackToPage("/_Host");
});
}
}