-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
26 lines (20 loc) · 706 Bytes
/
Copy pathProgram.cs
File metadata and controls
26 lines (20 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Author: Daniel Liedke
// Copyright (c) 2026 Daniel Liedke. All rights reserved.
// Proprietary software. Unauthorized use, copying, or distribution is prohibited.
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.StaticFiles;
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
{
Args = args,
WebRootPath = "dist"
});
var app = builder.Build();
// ES modules must be served with a JavaScript MIME type for browsers to load them.
var contentTypes = new FileExtensionContentTypeProvider();
contentTypes.Mappings[".mjs"] = "text/javascript";
app.UseDefaultFiles();
app.UseStaticFiles(new StaticFileOptions
{
ContentTypeProvider = contentTypes
});
app.Run();