Commit 8e4b3c7 1 parent 7a8b897 commit 8e4b3c7 Copy full SHA for 8e4b3c7
File tree 2 files changed +25
-0
lines changed
MiniSpace.Services.Students/src
MiniSpace.Services.Students.Api
MiniSpace.Services.Students.Application/Hubs
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,28 @@ public static async Task Main(string[] args)
35
35
. AddInfrastructure ( ) ;
36
36
37
37
services . AddGrpc ( ) ;
38
+
39
+ services . AddCors ( options =>
40
+ {
41
+ options . AddPolicy ( "CorsPolicy" ,
42
+ builder => builder
43
+ . AllowAnyMethod ( )
44
+ . AllowAnyHeader ( )
45
+ . AllowCredentials ( )
46
+ . SetIsOriginAllowed ( host => true ) ) ;
47
+ } ) ;
48
+
49
+ services . AddSignalR ( ) ;
38
50
} )
39
51
. Configure ( app => app
40
52
. UseInfrastructure ( )
53
+ . UseCors ( "CorsPolicy" )
54
+ . UseEndpoints ( endpoints =>
55
+ {
56
+ endpoints . MapGrpcService < StudentServiceGrpc > ( ) ;
57
+ endpoints . MapHub < MiniSpace . Services . Students . Application . Hubs . PresenceHub > ( "/presenceHub" )
58
+ . RequireCors ( "CorsPolicy" ) ;
59
+ } )
41
60
. UseDispatcherEndpoints ( endpoints => endpoints
42
61
. Get ( "" , ctx => ctx . Response . WriteAsync ( ctx . RequestServices . GetService < AppOptions > ( ) . Name ) )
43
62
. Get < GetStudents , Application . Queries . PagedResult < StudentDto > > ( "students" )
Original file line number Diff line number Diff line change
1
+ namespace MiniSpace . Services . Students . Application . Hubs ;
2
+
3
+ public class PresenceHub
4
+ {
5
+
6
+ }
You can’t perform that action at this time.
0 commit comments