overleaf/services/web/app/coffee/Features/Uploads/UploadsRouter.coffee
Henry Oswald 1cc0cbe8fc split site into 2 routers, webRouter and apiRouter
web router has things like sessions etc added onto it. Api router is minimal, doesn't include things like csrf
2015-07-01 15:23:18 +01:00

13 lines
511 B
CoffeeScript

SecurityManager = require('../../managers/SecurityManager')
AuthenticationController = require('../Authentication/AuthenticationController')
ProjectUploadController = require "./ProjectUploadController"
module.exports =
apply: (webRouter, apiRouter) ->
webRouter.post '/project/new/upload',
AuthenticationController.requireLogin(),
ProjectUploadController.uploadProject
webRouter.post '/Project/:Project_id/upload',
SecurityManager.requestCanModifyProject,
ProjectUploadController.uploadFile