Closed reesericci closed 2 years ago
import { Server } from 'ws'
import { tinyws } from 'tinyws'
import { App } from '@tinyhttp/app'
const app = new App()
const wss = new Server({ noServer: true })
app.use(tinyws(opts, wss))
@talentlessguy ... I have implemented as you recommended, but I am not sure how to access thewss
instance from within a handler? Any suggestions?
@go4cas wss here has a global scope so you can just use it within a handler as any other variable
app.use((req, res) => {
// wss.something
})
Is there a method for accessing the websocket server?