refactor: AppPaths.WwwRoot – zentrale wwwroot-Pfadauflösung
- Neue statische Klasse AppPaths mit WwwRoot-Property - Dev-Modus: ../../../wwwroot (Quell-Verzeichnis) - Publish-Modus: Fallback auf BaseDirectory/wwwroot - Program.cs + RemoteEndpoint.cs nutzen AppPaths statt eigener Logik
This commit is contained in:
1 parent
49ef6bedc6
commit
ab64a843fc
3 files changed
+32
-4
No files matched your search
@@ -241,7 +241,7 @@ public static class RemoteEndpoint
|
||||
|
||||
private static async Task<IResult> ServeScript(HttpContext ctx)
|
||||
{
|
||||
var scriptPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "remote.ps1");
|
||||
var scriptPath = Path.Combine(AppPaths.WwwRoot, "remote.ps1");
|
||||
if (!File.Exists(scriptPath))
|
||||
return Results.NotFound("Script nicht gefunden");
|
||||
|
||||
|
||||
Reference in new issue
Block a user