demo_trade_image_api/Program.cs

16 lines
371 B
C#
Raw Normal View History

2024-10-04 13:00:40 +00:00
using Microsoft.Extensions.FileProviders;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.UseStaticFiles( new StaticFileOptions {
FileProvider = new PhysicalFileProvider(
Path.Combine(builder.Environment.ContentRootPath, "Images")),
RequestPath = "/images"
}
);
app.Run();