Custom 404 page

This commit is contained in:
SinTan1729 2022-11-12 20:12:25 -06:00
parent cc15ffa463
commit cfdc7a7644
2 changed files with 15 additions and 1 deletions

View File

@ -58,7 +58,7 @@ public class Routes {
.findForShortUrl(shortUrl); .findForShortUrl(shortUrl);
if (longUrlOpt.isEmpty()) { if (longUrlOpt.isEmpty()) {
res.status(404); res.redirect("404.html");
return ""; return "";
} }
urlRepository.addHit(shortUrl); urlRepository.addHit(shortUrl);

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Error 404</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
</head>
<body style="text-align: center;">
<h1>Error 404!</h1>
It's okay, we all make mistakes.
</body>
</html>