33 lines
660 B
C#
33 lines
660 B
C#
using System.Text.Encodings.Web;
|
|
using System.Text.Unicode;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddSingleton(
|
|
HtmlEncoder.Create(allowedRanges: [ UnicodeRanges.BasicLatin,
|
|
UnicodeRanges.Arabic ]));
|
|
|
|
builder.Services.AddRazorPages(options =>
|
|
{
|
|
options.Conventions.AddPageRoute("/index", "{*url}");
|
|
});
|
|
|
|
builder.Services.AddHttpClient();
|
|
|
|
var app = builder.Build();
|
|
|
|
// Configure the HTTP request pipeline.
|
|
if (!app.Environment.IsDevelopment())
|
|
{
|
|
app.UseExceptionHandler("/Error");
|
|
}
|
|
app.UseStaticFiles();
|
|
|
|
app.UseRouting();
|
|
|
|
app.UseAuthorization();
|
|
|
|
app.MapRazorPages();
|
|
|
|
app.Run();
|