AnalyticsController.coffee 407 B

123456789
  1. AnalyticsManager = require "./AnalyticsManager"
  2. AuthenticationController = require("../Authentication/AuthenticationController")
  3. module.exports = AnalyticsController =
  4. recordEvent: (req, res, next) ->
  5. user_id = AuthenticationController.getLoggedInUserId(req) or req.sessionID
  6. AnalyticsManager.recordEvent user_id, req.params.event, req.body, (error) ->
  7. return next(error) if error?
  8. res.send 204