ws test
This commit is contained in:
parent
42cb907cfc
commit
4de905972c
3 changed files with 7 additions and 7 deletions
|
|
@ -13,9 +13,11 @@ import { OrganizationController } from "./controllers/OrganizationController";
|
|||
import logMiddleware from "./middlewares/logs";
|
||||
import { CommandController } from "./controllers/CommandController";
|
||||
import { ProfileSalaryController } from "./controllers/ProfileSalaryController";
|
||||
import { WebSocketServer } from "ws";
|
||||
import http from "http";
|
||||
import { wss } from "../src/services/webSocket";
|
||||
|
||||
export const wss = new WebSocketServer({ noServer: true,
|
||||
path: "/api/v1/org/socket",
|
||||
});
|
||||
|
||||
async function main() {
|
||||
await AppDataSource.initialize();
|
||||
|
|
|
|||
|
|
@ -3540,7 +3540,7 @@ export class ReportController extends Controller {
|
|||
}
|
||||
const metaData = { template: "report2", reportName: "report2", data: { data } };
|
||||
sendWebSocket(metaData)
|
||||
// return new HttpSuccess({ template: "report2", reportName: "report2", data: { data } });
|
||||
return new HttpSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import { WebSocket, WebSocketServer } from "ws";
|
||||
export const wss = new WebSocketServer({ noServer: true,
|
||||
path: "/api/v1/org/socket",
|
||||
});
|
||||
import { WebSocket } from "ws";
|
||||
import { wss } from "../app";
|
||||
|
||||
export async function sendWebSocket(data:any){
|
||||
wss.clients.forEach((client: any) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue