Skip to content

Commit

Permalink
Show server errors as html
Browse files Browse the repository at this point in the history
  • Loading branch information
RblSb committed Aug 15, 2024
1 parent 4c4eaca commit 6419916
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions build/server.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/server/HttpServer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class HttpServer {
}

static function readFileError(err:Dynamic, res:ServerResponse, filePath:String):Void {
res.setHeader("Content-Type", getMimeType("html"));
if (err.code == "ENOENT") {
res.statusCode = 404;
var rel = JsPath.relative(dir, filePath);
Expand Down

0 comments on commit 6419916

Please sign in to comment.