Answer the question
In order to leave comments, you need to log in
Express + ws pass ws to router?
There is an app.js file in which the authRoutes.js route is
connected
app.use('/auth', authRoutes)
router.get('/get-data', async (req, res) => {
try {
const jackpot = await getData()
//и отсюда отправить сообщение всем пользователям. Как это сделать?
res.status(200).json(jackpot)
} catch (e) {
res.status(400).json({ msg: 'invalid_request'})
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question