Add project files.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
using SampleWorkflowWeb.Services;
|
||||
using Caspian.WorkflowFramework;
|
||||
using MongoLogger;
|
||||
using MongoLogger.Models;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllersWithViews();
|
||||
|
||||
//Workflow
|
||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||
builder.AddWorkflowFramework(connectionString);
|
||||
|
||||
builder.Services.AddMongoLogger<LogModel>(builder.Configuration);
|
||||
|
||||
builder.Services.AddSingleton<ICardService, CardService>();
|
||||
|
||||
builder.Services.AddSession(options =>
|
||||
{
|
||||
options.IdleTimeout = TimeSpan.FromMinutes(30); // Adjust as needed
|
||||
options.Cookie.HttpOnly = true;
|
||||
options.Cookie.IsEssential = true;
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseMongoLogger<LogModel>();
|
||||
|
||||
//Workflow
|
||||
app.UseWorkflowFramework();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseExceptionHandler("/Home/Error");
|
||||
}
|
||||
app.UseRouting();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapStaticAssets();
|
||||
|
||||
app.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}")
|
||||
.WithStaticAssets();
|
||||
|
||||
app.UseSession();
|
||||
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user