Ver Fonte

Add socket.io emitter

sbkwgh há 8 anos atrás
pai
commit
8633a419b6
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      routes/thread.js

+ 4 - 0
routes/thread.js

@@ -134,6 +134,10 @@ router.post('/', async (req, res) => {
 			]
 		}))
 
+		req.app.get('io').emit('new thread', {
+			category: category.name
+		})
+
 	} catch (e) {
 		if(e === Errors.VALIDATION_ERROR) {
 			res.status(400)