summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-06-15 07:32:35 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-06-15 07:32:35 +0300
commitecf537fdca168b2acf3b0ee6fae1f5a2c78aafee (patch)
treeeb52b03b9c2aea1434e8d819c627a11dc62ccb84 /Program.cs
parent3655495dfdb1c0024eafa4efe3d6ab745e087af0 (diff)
Move robots.txt to Razor Pages
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs6
1 files changed, 0 insertions, 6 deletions
diff --git a/Program.cs b/Program.cs
index 60f5c15..3dbb243 100644
--- a/Program.cs
+++ b/Program.cs
@@ -2,7 +2,6 @@ using Microsoft.EntityFrameworkCore;
using MyDarling.Models;
using MyDarling.Services;
using Microsoft.AspNetCore.Identity;
-using MyDarling.Controllers;
var builder = WebApplication.CreateBuilder(args);
@@ -28,7 +27,6 @@ builder.Services.Configure<IdentityOptions>( opts =>
});
builder.Services.AddTransient<IImageResizer, ImageResizer>();
-builder.Services.AddScoped<IRobotsTxtGenerator, RobotsTxtGenerator>();
builder.Services.AddControllersWithViews();
builder.Services.AddRazorPages();
@@ -39,10 +37,6 @@ app.MapControllers();
app.MapDefaultControllerRoute();
app.MapRazorPages();
-var robotsScope = app.Services.CreateScope();
-var robotsGenerator = robotsScope.ServiceProvider.GetService<IRobotsTxtGenerator>();
-app.MapGet("/robots.txt", () => robotsGenerator!.GetRobotsText());
-
app.UseAuthentication();
app.UseAuthorization();
IdentitySeedData.CreateAdminAccount(app.Services, app.Configuration);