2014-02-12 05:23:40 -05:00
|
|
|
SecurityManager = require('../../managers/SecurityManager')
|
|
|
|
AuthenticationController = require('../Authentication/AuthenticationController')
|
|
|
|
ProjectUploadController = require "./ProjectUploadController"
|
2015-12-01 08:08:49 -05:00
|
|
|
RateLimiterMiddlewear = require('../Security/RateLimiterMiddlewear')
|
2014-02-12 05:23:40 -05:00
|
|
|
|
|
|
|
module.exports =
|
2015-06-30 09:38:32 -04:00
|
|
|
apply: (webRouter, apiRouter) ->
|
|
|
|
webRouter.post '/project/new/upload',
|
2014-02-12 05:23:40 -05:00
|
|
|
AuthenticationController.requireLogin(),
|
|
|
|
ProjectUploadController.uploadProject
|
2015-12-01 08:08:49 -05:00
|
|
|
|
2015-06-30 09:38:32 -04:00
|
|
|
webRouter.post '/Project/:Project_id/upload',
|
2015-12-01 08:08:49 -05:00
|
|
|
RateLimiterMiddlewear.rateLimit({
|
|
|
|
endpointName: "file-upload"
|
|
|
|
params: ["Project_id"]
|
|
|
|
maxRequests: 100
|
|
|
|
timeInterval: 60 * 20
|
|
|
|
}),
|
2014-02-12 05:23:40 -05:00
|
|
|
SecurityManager.requestCanModifyProject,
|
|
|
|
ProjectUploadController.uploadFile
|
|
|
|
|