overleaf/services/web/app/coffee/Features/Templates/TemplatesRouter.coffee
Simon Detheridge 3553fb2d9d Merge pull request #1581 from sharelatex/spd-wearing-middle
Fix spelling of "middleware"

GitOrigin-RevId: d2b2b20ad8a6871cd6366303e75b340f0f2f2dda
2019-03-11 11:05:12 +00:00

15 lines
727 B
CoffeeScript

AuthenticationController = require('../Authentication/AuthenticationController')
TemplatesController = require("./TemplatesController")
TemplatesMiddleware = require('./TemplatesMiddleware')
RateLimiterMiddleware = require('../Security/RateLimiterMiddleware')
module.exports =
apply: (app)->
app.get '/project/new/template/:Template_version_id', TemplatesMiddleware.saveTemplateDataInSession, AuthenticationController.requireLogin(), TemplatesController.getV1Template
app.post '/project/new/template', AuthenticationController.requireLogin(), RateLimiterMiddleware.rateLimit({
endpointName: "create-project-from-template"
maxRequests: 20
timeInterval: 60
}), TemplatesController.createProjectFromV1Template