2025-08-01 00:30:05 +07:00
|
|
|
using lilos_stitcher;
|
|
|
|
|
|
2025-07-31 23:56:15 +07:00
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
2025-07-19 17:44:08 +07:00
|
|
|
|
2025-08-01 00:30:05 +07:00
|
|
|
NetVips.NetVips.Init();
|
|
|
|
|
NetVips.NetVips.Concurrency = 3;
|
2025-07-31 23:34:36 +07:00
|
|
|
|
2025-08-01 00:30:05 +07:00
|
|
|
builder.Services.AddControllers().AddJsonOptions(o => o.JsonSerializerOptions.PropertyNameCaseInsensitive = true);
|
2025-07-31 23:34:36 +07:00
|
|
|
|
2025-08-01 00:30:05 +07:00
|
|
|
builder.Services.AddMemoryCache(o => o.SizeLimit = 128L * 1024 * 1024);
|
2025-07-31 23:34:36 +07:00
|
|
|
|
2025-08-01 00:53:20 +07:00
|
|
|
string assetDir = assetDir = Environment.GetEnvironmentVariable("ASSET_PATH_RO") ?? throw new InvalidOperationException("dir not found");
|
2025-07-19 17:44:08 +07:00
|
|
|
|
2025-08-01 00:30:05 +07:00
|
|
|
builder.Services.AddSingleton<TileCache>();
|
|
|
|
|
builder.Services.AddSingleton(provider => new TileLoader(provider.GetRequiredService<TileCache>(), assetDir));
|
|
|
|
|
builder.Services.AddSingleton<lilos_stitcher.LiloStitcher>();
|
2025-07-31 23:34:36 +07:00
|
|
|
|
2025-08-01 00:30:05 +07:00
|
|
|
var app = builder.Build();
|
2025-07-31 23:56:15 +07:00
|
|
|
app.MapControllers();
|
|
|
|
|
app.Run();
|