2024-05-21 16:41:01 +02:00
|
|
|
using Foxchat.Chat.Middleware;
|
2024-05-21 20:14:52 +02:00
|
|
|
using Foxchat.Chat.Services;
|
|
|
|
using Foxchat.Core.Middleware;
|
2024-05-21 16:41:01 +02:00
|
|
|
|
|
|
|
namespace Foxchat.Chat.Extensions;
|
|
|
|
|
|
|
|
public static class WebApplicationExtensions
|
|
|
|
{
|
|
|
|
public static IServiceCollection AddCustomMiddleware(this IServiceCollection services)
|
|
|
|
{
|
|
|
|
return services
|
2024-05-21 20:14:52 +02:00
|
|
|
.AddScoped<ErrorHandlerMiddleware>()
|
|
|
|
.AddScoped<ServerAuthenticationMiddleware>();
|
2024-05-21 16:41:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static IApplicationBuilder UseCustomMiddleware(this IApplicationBuilder app)
|
|
|
|
{
|
|
|
|
return app
|
2024-05-21 20:14:52 +02:00
|
|
|
.UseMiddleware<ErrorHandlerMiddleware>()
|
|
|
|
.UseMiddleware<ServerAuthenticationMiddleware>();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static IServiceCollection AddChatServices(this IServiceCollection services)
|
|
|
|
{
|
|
|
|
return services
|
|
|
|
.AddScoped<UserResolverService>();
|
2024-05-21 16:41:01 +02:00
|
|
|
}
|
|
|
|
}
|