Simple image host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

template.node.js 330B

123456789101112131415161718
  1. module.exports = function(ctx) {
  2. var name = ctx.req.url.split("?")[1];
  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. }