mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 12:11:10 +00:00
Adds initial ASP.NET Core MVC replacement for Blazor WASM
This commit is contained in:
1 parent
5409200c7a
commit
193861c9c5
56 files changed
+505
-4139
No files matched your search
@@ -1,37 +1,52 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web;
|
||||
|
||||
/// <summary>
|
||||
/// Application entry point, contains the composition root module, wires up all dependencies of the application.
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Application entry point.
|
||||
/// </summary>
|
||||
/// <param name="args">Optional command line arguments.</param>
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
WebAssemblyHostBuilder builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
|
||||
builder.AddConfiguration();
|
||||
builder.Services.AddPresentationWebLayerServices();
|
||||
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
||||
|
||||
WebAssemblyHost webAssemblyHost = builder.Build();
|
||||
|
||||
await webAssemblyHost.RunAsync().ConfigureAwait(false);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Presentation.Web.Common.DependencyInjection;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Presentation.Web;
|
||||
|
||||
/// <summary>
|
||||
/// Application entry point, contains the composition root module, wires up all dependencies of the application.
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Application entry point.
|
||||
/// </summary>
|
||||
/// <param name="args">Optional command line arguments.</param>
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.BindConfiguration(builder.Configuration);
|
||||
builder.Services.AddPresentationWebLayerServices();
|
||||
|
||||
WebApplication app = builder.Build();
|
||||
|
||||
// configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseExceptionHandler("/Home/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.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
await app.RunAsync();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
Reference in new issue
Block a user