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.

favicon.node.js 280B

12345678910111213
  1. var fs = require("fs");
  2. module.exports = function(ctx) {
  3. var readStream = fs.createReadStream("favicon.ico");
  4. readStream.pipe(ctx.res);
  5. readStream.on("error", function(err) {
  6. if (err.code === "ENOENT")
  7. ctx.end(ctx.view("404"));
  8. else
  9. ctx.end(err.toString());
  10. });
  11. }