Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Created January 29, 2024 15:02
Show Gist options
  • Save sitefinitySDK/489ecb10dd257af37b76997ed1fe5233 to your computer and use it in GitHub Desktop.
Save sitefinitySDK/489ecb10dd257af37b76997ed1fe5233 to your computer and use it in GitHub Desktop.
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Progress.Sitefinity.AspNetCore;
using Progress.Sitefinity.AspNetCore.FormWidgets;
using Progress.Sitefinity.AspNetCore.Web.Security;
using html_sanitizer;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddSitefinity();
builder.Services.AddViewComponentModels();
builder.Services.AddFormViewComponentModels();
builder.Services.AddSingleton<IHtmlSanitizer, CustomHtmlSanitizer>();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseStaticFiles();
app.UseRouting();
app.UseSitefinity();
app.Run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment