Simple image host.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

template.node.js 314B

123456789101112131415161718
  1. module.exports = function(ctx) {
  2. var name = ctx.query;
  3. if (!name)
  4. return ctx.fail("You must supply a template name.");
  5. ctx.getPostData(function(err, data) {
  6. if (err)
  7. return ctx.fail(err);
  8. try {
  9. ctx.succeed({
  10. html: ctx.template(name, data)
  11. });
  12. } catch (err) {
  13. ctx.fail(err);
  14. }
  15. });
  16. }