mirror of
https://github.com/cheveguerra/botLeiferAurik-Mod_2.0.git
synced 2026-04-18 03:39:16 +00:00
21 lines
466 B
JavaScript
21 lines
466 B
JavaScript
const middlewareClient = (client = null) => async (req, res, next) => {
|
|
try {
|
|
|
|
if(!client){
|
|
res.status(409)
|
|
// console.log(client)
|
|
res.send({ error: 'Error de client.' })
|
|
}else{
|
|
req.clientWs = client;
|
|
next()
|
|
}
|
|
|
|
|
|
} catch (e) {
|
|
console.log(e)
|
|
res.status(409)
|
|
res.send({ error: 'Error de client' })
|
|
}
|
|
|
|
}
|
|
module.exports = { middlewareClient } |