proudmonkey / AutoWrapper

A simple, yet customizable global exception handler and Http response wrapper for ASP.NET Core APIs.
MIT License
679 stars 82 forks source link

add ExcludePaths, to make the SignalR endpoint take effect. #101

Closed chen1tian closed 3 years ago

chen1tian commented 3 years ago

Support for SignalR

if you have a SigalR EndPoint,like:

app.UseEndpoints(endpoints =>
{
    endpoints.MapControllers();
    endpoints.MapHub<NoticeHub>("/notice");
});

then you can use ExcludePaths exclude it to make the SignalR endpoint take effect.

app.UseCustomAutoWrapper(new AutoWrapper.AutoWrapperOptions
{      
    ExcludePaths = new string[] { "/notice" }
});
proudmonkey commented 3 years ago

@chen1tian Thanks for the PR. This is a great addition to AutoWrapper feature! I will merge this if you are confident with it. In the upcoming .NET 5 conversion, I think we should merge the /swagger path to this new feature as the default exclude path. What do you think?

proudmonkey commented 3 years ago

Thank you, @chen1tian - Merged and added you to the contributor list :)