|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using IdentityProvider.Services;
- using ProtoBuf.Grpc.Server;
-
- var builder = WebApplication.CreateBuilder(args);
-
- // Additional configuration is required to successfully run gRPC on macOS.
- // For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682
-
- builder.Services.AddControllersWithViews();
- builder.Services.AddRazorPages();
-
- builder.Services.AddEndpointsApiExplorer();
-
- builder.Services.AddGrpc();
- builder.Services.AddCodeFirstGrpc();
- builder.Services.AddCodeFirstGrpcReflection();
-
- var app = builder.Build();
-
- // Configure the HTTP request pipeline.
- if (app.Environment.IsDevelopment())
- {
- app.UseWebAssemblyDebugging();
- }
- else
- {
- 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.UseBlazorFrameworkFiles();
- app.UseStaticFiles();
-
- app.UseRouting();
-
- app.UseGrpcWeb();
-
- app.MapRazorPages();
- app.MapControllers();
-
- //app.MapGrpcService<WeatherService>();
- app.MapGrpcService<AuthService>().EnableGrpcWeb();
-
- app.MapCodeFirstGrpcReflectionService();
-
- app.MapFallbackToFile("index.html");
-
- app.Run();
|