fixed cors
This commit is contained in:
@@ -5,12 +5,20 @@ import {
|
||||
WebSocketServer,
|
||||
} from '@nestjs/websockets';
|
||||
import { Server, Socket } from 'socket.io';
|
||||
import { SocketService } from './socket.service';
|
||||
import { SendMessageDto } from './dto/sendMessage.dto';
|
||||
import { SocketService } from './socket.service';
|
||||
|
||||
@WebSocketGateway()
|
||||
@WebSocketGateway({
|
||||
namespace: '/notification',
|
||||
cors: {
|
||||
origin: '*',
|
||||
},
|
||||
transports: ['websocket'],
|
||||
path: '/notification/socket.io', // آدرس سفارشی
|
||||
})
|
||||
export class SocketGateway implements OnGatewayConnection {
|
||||
@WebSocketServer() server: Server;
|
||||
@WebSocketServer()
|
||||
server: Server;
|
||||
|
||||
constructor(private socketService: SocketService) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user