mirror of
https://github.com/SinTan1729/chhoto-url
synced 2024-12-26 07:38:36 -06:00
Custom 404 page
This commit is contained in:
parent
cc15ffa463
commit
cfdc7a7644
2 changed files with 15 additions and 1 deletions
|
@ -58,7 +58,7 @@ public class Routes {
|
|||
.findForShortUrl(shortUrl);
|
||||
|
||||
if (longUrlOpt.isEmpty()) {
|
||||
res.status(404);
|
||||
res.redirect("404.html");
|
||||
return "";
|
||||
}
|
||||
urlRepository.addHit(shortUrl);
|
||||
|
|
14
src/main/resources/public/404.html
Normal file
14
src/main/resources/public/404.html
Normal 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>
|
Loading…
Reference in a new issue