Use new static assets middleware
All checks were successful
Docker Image CI / build (push) Successful in 2m8s

This commit is contained in:
James Chapman 2024-07-12 00:45:34 +01:00
parent 2f5212f8d0
commit 8669904edd
Signed by: jamsch0
GPG Key ID: 765FE58130277547
2 changed files with 8 additions and 5 deletions

View File

@ -9,10 +9,12 @@
<meta name="view-transition" content="same-origin" /> <meta name="view-transition" content="same-origin" />
<meta name="turbo-prefetch" content="false" /> <meta name="turbo-prefetch" content="false" />
<link rel="stylesheet" type="text/css" href="/css/main.css" asp-append-version="true" data-turbo-track="reload" /> <link rel="stylesheet" type="text/css" href="@Assets["css/main.css"]" data-turbo-track="reload" />
<script type="module" src="/js/main.js" asp-append-version="true" data-turbo-track="reload"></script> <ImportMap />
<script type="module" src="/lib/hotwired/turbo/dist/turbo.es2017-esm.js"></script>
<script type="module" src="@Assets["js/main.js"]" data-turbo-track="reload"></script>
<script type="module" src="@Assets["lib/hotwired/turbo/dist/turbo.es2017-esm.js"]"></script>
<HeadOutlet /> <HeadOutlet />
</head> </head>

View File

@ -51,11 +51,12 @@ builder.Services.AddDbContextPool<AppDbContext>(options => options
var app = builder.Build(); var app = builder.Build();
app.UseStaticFiles();
app.UseRouting(); app.UseRouting();
app.UseSession(); app.UseSession();
app.MapControllers(); app.MapStaticAssets();
app.MapControllers()
.WithStaticAssets();
await app.RunAsync(); await app.RunAsync();