fixing fotos path
This commit is contained in:
parent
b58669f29f
commit
8eb17986fa
@ -12,11 +12,6 @@ namespace OpenCand.API
|
|||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
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.
|
// Add services to the container.
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
|
|
||||||
@ -34,7 +29,7 @@ namespace OpenCand.API
|
|||||||
app.UseSwaggerUI();
|
app.UseSwaggerUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
var workingDir = Path.GetDirectoryName(Environment.ProcessPath);
|
var workingDir = Directory.GetCurrentDirectory();
|
||||||
app.UseStaticFiles(new StaticFileOptions
|
app.UseStaticFiles(new StaticFileOptions
|
||||||
{
|
{
|
||||||
FileProvider = new PhysicalFileProvider(Path.Combine(workingDir, "fotos_cand")),
|
FileProvider = new PhysicalFileProvider(Path.Combine(workingDir, "fotos_cand")),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user