mirror of
https://github.com/cheveguerra/botGuna.git
synced 2026-04-17 19:37:07 +00:00
Commit inicial
This commit is contained in:
21
middleware/client.js
Normal file
21
middleware/client.js
Normal file
@@ -0,0 +1,21 @@
|
||||
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 }
|
||||
0
middleware/db.js
Normal file
0
middleware/db.js
Normal file
Reference in New Issue
Block a user