mort преди 8 години
родител
ревизия
2f79154930
променени са 5 файла, в които са добавени 16 реда и са изтрити 2 реда
  1. 1
    0
      .gitignore
  2. 1
    1
      server.js
  3. Двоични данни
      web/favicon.ico
  4. 13
    0
      web/favicon.node.js
  5. 1
    1
      web/i/index.node.js

+ 1
- 0
.gitignore Целия файл

@@ -4,3 +4,4 @@ npm-debug.log
imgs
!imgs/.placeholder
.currentRun
favicon.ico

+ 1
- 1
server.js Целия файл

@@ -12,7 +12,7 @@ var conf = JSON.parse(fs.readFileSync("conf.json"));
var endpoints = {

//General
"/favicon.ico": "favicon.ico",
"/favicon.ico": "favicon.node.js",
"/global.css": "global.css",
"/global.js": "global.js",
"/404": "404.node.js",

Двоични данни
web/favicon.ico Целия файл


+ 13
- 0
web/favicon.node.js Целия файл

@@ -0,0 +1,13 @@
var fs = require("fs");

module.exports = function(ctx) {
var readStream = fs.createReadStream("favicon.ico");
readStream.pipe(ctx.res);

readStream.on("error", function(err) {
if (err.code === "ENOENT")
ctx.end(ctx.view("404"));
else
ctx.end(err.toString());
});
}

+ 1
- 1
web/i/index.node.js Целия файл

@@ -14,7 +14,7 @@ module.exports = function(ctx) {
readStream.pipe(ctx.res);

readStream.on("error", function(err){
if (err.code == "ENOENT")
if (err.code === "ENOENT")
ctx.end(ctx.view("404"));
else
ctx.end(err.toString());

Loading…
Отказ
Запис