-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (35 loc) · 1.28 KB
/
Program.cs
File metadata and controls
35 lines (35 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Program.cs
using Aspose.Cells.GridJs;
var builder = WebApplication.CreateBuilder(args);
// Add MVC services
builder.Services.AddControllersWithViews();
// ---------------------------------------------------------------------
// GridJs service registration
// ---------------------------------------------------------------------
builder.Services.AddScoped<IGridJsService, GridJsService>();
builder.Services.Configure<GridJsOptions>(options =>
{
// • Directory where GridJs caches converted files.
// Make sure the folder exists and the application has write permission.
options.FileCacheDirectory = @"D:\storage\Aspose.Cells.GridJs\";
// • Base route name for all GridJs actions (e.g. /GridJs/LoadSpreadsheet)
options.BaseRouteName = "/GridJs";
});
var app = builder.Build();
// ---------------------------------------------------------------------
// Middleware pipeline
// ---------------------------------------------------------------------
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
// Map default MVC route
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();