2018-05-31 06:12:31 -04:00
|
|
|
AuthenticationController = require('../Authentication/AuthenticationController')
|
|
|
|
TemplatesController = require("./TemplatesController")
|
|
|
|
TemplatesMiddlewear = require('./TemplatesMiddlewear')
|
2019-01-18 05:10:09 -05:00
|
|
|
RateLimiterMiddlewear = require('../Security/RateLimiterMiddlewear')
|
2018-05-31 06:12:31 -04:00
|
|
|
|
|
|
|
module.exports =
|
|
|
|
apply: (app)->
|
|
|
|
|
|
|
|
app.get '/project/new/template/:Template_version_id', TemplatesMiddlewear.saveTemplateDataInSession, AuthenticationController.requireLogin(), TemplatesController.getV1Template
|
|
|
|
|
2019-01-18 05:10:09 -05:00
|
|
|
app.post '/project/new/template', AuthenticationController.requireLogin(), RateLimiterMiddlewear.rateLimit({
|
|
|
|
endpointName: "create-project-from-template"
|
|
|
|
maxRequests: 20
|
|
|
|
timeInterval: 60
|
|
|
|
}), TemplatesController.createProjectFromV1Template
|