mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-29 15:42:18 +00:00
21 lines
405 B
JavaScript
21 lines
405 B
JavaScript
/*
|
|
* Events Controller
|
|
*
|
|
* Server API
|
|
* event:append - New event to be added to history
|
|
*
|
|
*/
|
|
|
|
const winston = require("winston");
|
|
const pubsub = require("./pubsub.js");
|
|
|
|
module.exports = namespace => {
|
|
pubsub.on("newEvent", event => {
|
|
if (!event.public) return;
|
|
namespace.emit("event:append", {
|
|
type: event.type,
|
|
description: event.description,
|
|
createdAt: event.createdAt
|
|
})
|
|
});
|
|
};
|