add 404 page
This commit is contained in:
parent
4ac130b9d2
commit
61777d5581
|
@ -0,0 +1,9 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>404</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>UH-OH</h1>
|
||||||
|
<p>The page you were looking for could not be found.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -79,8 +79,7 @@ public class Main {
|
||||||
sendResponse(client, "200 OK", contentType, Files.readAllBytes(filepath));
|
sendResponse(client, "200 OK", contentType, Files.readAllBytes(filepath));
|
||||||
} else {
|
} else {
|
||||||
// 404
|
// 404
|
||||||
byte[] notFoundContent = "<h1>404 Something went wrong</h1>".getBytes();
|
sendResponse(client, "404 Not Found", "text/html", Files.readAllBytes(getFilePath("404.html")));
|
||||||
sendResponse(client, "404 Not Found", "text/html", notFoundContent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue