Used AI to change project to blazor webassembly.
This commit is contained in:
24
Program.cs
24
Program.cs
@@ -1,18 +1,12 @@
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using DouwcoWebsite;
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllers(); // For API controllers
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
|
||||
var app = builder.Build();
|
||||
app.MapGet("/api/test", () => "test works!");
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
// No need for UseHttpsRedirection or UseHsts, as Nginx handles SSL.
|
||||
app.UseDefaultFiles(); // Enable default file serving
|
||||
app.UseStaticFiles(); // Serve static files from wwwroot
|
||||
app.UseRouting();
|
||||
app.UseAuthorization();
|
||||
// Register the scroll service for navigation
|
||||
builder.Services.AddScoped<ScrollService>();
|
||||
|
||||
app.MapControllers(); // Map API controllers
|
||||
|
||||
app.Run();
|
||||
await builder.Build().RunAsync();
|
||||
|
||||
Reference in New Issue
Block a user