overleaf/services/web/app/coffee/Features/Analytics/AnalyticsRouter.coffee

26 lines
981 B
CoffeeScript
Raw Normal View History

2017-12-21 08:51:52 -05:00
AuthenticationController = require './../Authentication/AuthenticationController'
AnalyticsController = require('./AnalyticsController')
2017-12-21 08:51:52 -05:00
AnalyticsProxy = require('./AnalyticsProxy')
module.exports =
apply: (webRouter, privateApiRouter, publicApiRouter) ->
webRouter.post '/event/:event', AnalyticsController.recordEvent
2018-01-22 11:20:08 -05:00
webRouter.put '/editingSession/:projectId',
AnalyticsController.updateEditingSession
publicApiRouter.use '/analytics/graphs',
2017-12-21 08:51:52 -05:00
AuthenticationController.httpAuth,
AnalyticsProxy.call('/graphs')
publicApiRouter.use '/analytics/recentTeamActivity',
AuthenticationController.httpAuth,
AnalyticsProxy.call('/recentTeamActivity')
publicApiRouter.use '/analytics/recentV1TemplateIdsActivity',
AuthenticationController.httpAuth,
AnalyticsProxy.call('/recentV1TemplateIdsActivity')
publicApiRouter.use '/analytics/uniExternalCollaboration',
AuthenticationController.httpAuth,
AnalyticsProxy.call('/uniExternalCollaboration')