|
@@ -122,16 +122,21 @@ app.UseCors(x => x
|
|
|
.AllowCredentials()); // allow credentials
|
|
|
|
|
|
|
|
|
-app.MapPost("broadcast", async (string message, IHubContext<ChatHub, IChatClient> context) =>
|
|
|
-{
|
|
|
- await context.Clients.All.ReceiveMessage(message);
|
|
|
- return Results.NoContent();
|
|
|
-});
|
|
|
+//app.MapPost("broadcast", async (string message, IHubContext<ChatHub, IChatClient> context) =>
|
|
|
+//{
|
|
|
+// await context.Clients.All.ReceiveMessage(message);
|
|
|
+// return Results.NoContent();
|
|
|
+//});
|
|
|
+
|
|
|
+//app.UseEndpoints(endpoints =>
|
|
|
+//{
|
|
|
+// endpoints.MapHub<ChatHub>("/chatHub");
|
|
|
+//});
|
|
|
app.UseHttpsRedirection();
|
|
|
app.UseAuthentication();
|
|
|
app.UseAuthorization();
|
|
|
app.UseMiddleware<LoggingMiddleware>();
|
|
|
app.MapControllers();
|
|
|
-app.MapHub<ChatHub>("chat-hub");
|
|
|
+app.MapHub<ChatHub>("/chatHub");
|
|
|
|
|
|
app.Run();
|