2024-02-19 12:54:56 +00:00
|
|
|
using KeymailSpecials2.Components;
|
2024-03-18 09:19:07 +00:00
|
|
|
using KeymailSpecials2.Components.Services;
|
2024-09-06 21:57:14 +00:00
|
|
|
using Microsoft.AspNetCore.Builder;
|
2024-07-19 18:33:58 +00:00
|
|
|
using Microsoft.Extensions.FileProviders;
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
internal class Program
|
|
|
|
{
|
|
|
|
private static void Main(string[] args)
|
|
|
|
{
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
// Add services to the container.
|
|
|
|
builder.Services.AddRazorComponents()
|
|
|
|
.AddInteractiveServerComponents();
|
2024-07-19 18:33:58 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
builder.Services.AddSingleton<GlobalService>(); // Global variables shared by all users
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
var app = builder.Build();
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
// Configure the HTTP request pipeline.
|
|
|
|
if (!app.Environment.IsDevelopment())
|
|
|
|
{
|
|
|
|
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
|
|
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
|
|
|
app.UseHsts();
|
|
|
|
}
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
app.UseHttpsRedirection();
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-09-06 21:57:14 +00:00
|
|
|
app.UseStaticFiles();
|
2024-07-19 18:33:58 +00:00
|
|
|
app.UseStaticFiles(new StaticFileOptions()
|
|
|
|
{
|
|
|
|
FileProvider = new PhysicalFileProvider(@"\\toronto\d$\EmailMarketing\im3"),
|
|
|
|
RequestPath = "/im3"
|
|
|
|
});
|
2024-03-18 09:19:07 +00:00
|
|
|
app.UseAntiforgery();
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
app.MapRazorComponents<App>()
|
|
|
|
.AddInteractiveServerRenderMode();
|
2024-02-19 12:54:56 +00:00
|
|
|
|
2024-03-18 09:19:07 +00:00
|
|
|
app.Run();
|
|
|
|
}
|
|
|
|
}
|