TemplatesRouter.coffee 958 B

12345678910111213141516171819
  1. TemplatesWebController = require("./TemplatesWebController")
  2. middleWear = require("./TemplatesMiddlewear")
  3. module.exports =
  4. apply: (app)->
  5. app.get "/templates", middleWear.insert_templates_user_id, TemplatesWebController.renderTemplatesIndexPage
  6. app.get "/templates/user/:user_id", TemplatesWebController.renderTemplatesIndexPage
  7. app.get "/templates/:tag_or_template_id", middleWear.id_or_tag_parse, middleWear.insert_templates_user_id, TemplatesWebController.tagOrCanonicalPage
  8. app.get "/templates/user/:user_id/:tag_or_template_id", middleWear.id_or_tag_parse, TemplatesWebController.tagOrCanonicalPage
  9. app.get "/templates/:tag_name/:template_name", middleWear.insert_templates_user_id, TemplatesWebController.renerTemplateInTag
  10. app.get "/templates/user/:user_id/:tag_name/:template_name", TemplatesWebController.renerTemplateInTag
  11. app.get "/templates/:template_id/v/:version/:file_type", TemplatesWebController.proxyToTemplatesApi