Skip to content

Commit

Permalink
chore: add 404 page (#1260)
Browse files Browse the repository at this point in the history
* chore: add 404 page

* Update now.json

* Update now.json
  • Loading branch information
njzjz authored Jan 21, 2021
1 parent b153541 commit 4e215de
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions now.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
},
"builds": [
{"src": "package.json", "use": "@now/static-build"}
],
"routes": [
{ "src": "/.*", "headers": { "Link": "<https://cdn.jsdelivr.net>; rel=preconnect" }, "continue": true },
{ "handle": "filesystem" },
{ "src": "/.*", "status": 404, "dest": "404.html" }
]
}
17 changes: 17 additions & 0 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<html lang="en">

<head>
<meta charset="UTF-8">
<title>404 Not Found</title>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/@njzjz/404page@0.0.2/dist/main.css'>
</head>

<body>
<div class="error"></div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@njzjz/404page@0.0.2/dist/main.js"></script>
<script>bumpCode();</script>
</body>

</html>
3 changes: 2 additions & 1 deletion public/now.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
],
"routes": [
{ "src": "/.*", "headers": { "Link": "<https://cdn.jsdelivr.net>; rel=preconnect" }, "continue": true },
{ "handle": "filesystem" }
{ "handle": "filesystem" },
{ "src": "/.*", "status": 404, "dest": "404.html" }
]
}

1 comment on commit 4e215de

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for chemicaltools-web ready!

✅ Preview
https://chemicaltools-web-1czows18c.vercel.app

Built with commit 4e215de.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.