1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2024-12-26 23:58:35 -06:00

Custom 404 page

This commit is contained in:
Sayantan Santra 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);
if (longUrlOpt.isEmpty()) {
res.status(404);
res.redirect("404.html");
return "";
}
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>