mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-31 14:54:13 +00:00
12 lines
No EOL
495 B
CoffeeScript
12 lines
No EOL
495 B
CoffeeScript
WebsocketLoadBalancer = require "./WebsocketLoadBalancer"
|
|
logger = require "logger-sharelatex"
|
|
|
|
module.exports = HttpApiController =
|
|
sendMessage: (req, res, next) ->
|
|
logger.log {message: req.params.message}, "sending message"
|
|
if Array.isArray(req.body)
|
|
for payload in req.body
|
|
WebsocketLoadBalancer.emitToRoom req.params.project_id, req.params.message, payload
|
|
else
|
|
WebsocketLoadBalancer.emitToRoom req.params.project_id, req.params.message, req.body
|
|
res.send 204 # No content |