Files
2023-08-17 13:05:51 +03:30

10 lines
291 B
JavaScript

const wss = require('../server/WebSocket/wss')
const { isProduction } = require('../server/_env')
export default function () {
this.nuxt.hook('listen', (server, { host, port }) => {
// attach WebSocket Server to Nuxt Server in production mode
if (isProduction) wss(server)
})
}