fixing fotos path

This commit is contained in:
Jose Henrique 2025-05-31 11:22:04 -03:00
parent b58669f29f
commit 8eb17986fa

View File

@ -12,11 +12,6 @@ namespace OpenCand.API
{
var builder = WebApplication.CreateBuilder(args);
if (string.IsNullOrEmpty(Environment.ProcessPath))
{
throw new InvalidOperationException("Environment.ProcessPath is not set. Ensure the application is running in a valid environment.");
}
// Add services to the container.
builder.Services.AddControllers();
@ -34,7 +29,7 @@ namespace OpenCand.API
app.UseSwaggerUI();
}
var workingDir = Path.GetDirectoryName(Environment.ProcessPath);
var workingDir = Directory.GetCurrentDirectory();
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(workingDir, "fotos_cand")),