@@ -10,19 +10,21 @@ interface AudioData {
1010}
1111
1212const app = express ( ) ;
13- app . use ( cors ( {
14- origin : '*' ,
15- methods : [ 'GET' , 'POST' ] ,
16- credentials : true ,
17- } ) ) ;
13+ app . use (
14+ cors ( {
15+ origin : "*" ,
16+ methods : [ "GET" , "POST" ] ,
17+ credentials : true ,
18+ } )
19+ ) ;
1820
1921const httpServer = createServer ( app ) ;
2022const io = new Server ( httpServer , {
2123 cors : {
2224 origin : "*" ,
2325 methods : [ "GET" , "POST" ] ,
2426 credentials : true ,
25- allowedHeaders : [ "*" ]
27+ allowedHeaders : [ "*" ] ,
2628 } ,
2729 path : "/socket.io/" ,
2830 transports : [ "websocket" ] ,
@@ -33,7 +35,7 @@ const io = new Server(httpServer, {
3335
3436// Add connection error handling
3537io . engine . on ( "connection_error" , ( err ) => {
36- console . log ( ' Connection error:' , err ) ;
38+ console . log ( " Connection error:" , err ) ;
3739} ) ;
3840
3941io . on ( "connection" , ( socket : Socket ) => {
@@ -45,7 +47,7 @@ io.on("connection", (socket: Socket) => {
4547
4648 // Handle signaling data for WebRTC connections
4749 socket . on ( "signal" , ( signalData ) => {
48- console . log ( ' Received signal data, broadcasting to others' ) ;
50+ console . log ( " Received signal data, broadcasting to others" ) ;
4951 socket . broadcast . emit ( "signal" , signalData ) ;
5052 } ) ;
5153
@@ -54,11 +56,11 @@ io.on("connection", (socket: Socket) => {
5456 } ) ;
5557} ) ;
5658
57- app . get ( ' /health' , ( req , res ) => {
58- res . send ( ' Server is running' ) ;
59+ app . get ( " /health" , ( req , res ) => {
60+ res . send ( " Server is running" ) ;
5961} ) ;
6062
6163const PORT = process . env . AUDIO_PORT || 5555 ;
6264httpServer . listen ( PORT , ( ) => {
6365 console . log ( `Audio service is running on port ${ PORT } ` ) ;
64- } ) ;
66+ } ) ;
0 commit comments