1 | (function (factory) {
|
2 | if (typeof module === "object" && typeof module.exports === "object") {
|
3 | var v = factory(require, exports);
|
4 | if (v !== undefined) module.exports = v;
|
5 | }
|
6 | else if (typeof define === "function" && define.amd) {
|
7 | define(["require", "exports", "http"], factory);
|
8 | }
|
9 | })(function (require, exports) {
|
10 | "use strict";
|
11 | Object.defineProperty(exports, "__esModule", { value: true });
|
12 | var http_1 = require("http");
|
13 | function finalError() {
|
14 | return function (error, request, response, _) {
|
15 | var message = error.expose
|
16 | ? error.message
|
17 | : http_1.STATUS_CODES[error.statusCode];
|
18 | response.writeHead(error.statusCode, {
|
19 | 'Content-Type': 'text/html;charset=utf-8'
|
20 | });
|
21 | response.end("<!DOCTYPE html><title>" + error.statusCode + " " + message + "</title><h1>" + error.statusCode + " " + message + ": " + request.url + "</h1>\n<!-- " + new Array(512).join('.') + " -->");
|
22 | };
|
23 | }
|
24 | exports.default = finalError;
|
25 | });
|
26 |
|
\ | No newline at end of file |