mirror of
https://github.com/minoplhy/chhoto-url.git
synced 2024-11-22 09:16:46 +00:00
Custom 404 page
This commit is contained in:
parent
cc15ffa463
commit
cfdc7a7644
@ -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);
|
||||||
|
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 New Issue
Block a user