Parcourir la source

Add socket.io emitter

sbkwgh il y a 8 ans
Parent
commit
8633a419b6
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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)