增加一个404

This commit is contained in:
luchenqun 2017-04-11 18:59:35 +08:00
parent f3dee72b26
commit ed4d92d3cd
3 changed files with 63 additions and 4 deletions

9
app.js
View File

@ -69,10 +69,11 @@ if (app.get('env') === 'development') {
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
res.sendfile("./public/404.html");
// res.render('error', {
// message: err.message,
// error: {}
// });
});
api.checkSnapFaviconState();
api.getSnapByTimer();

58
public/404.html Normal file
View File

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>提示-404</title>
<style type="text/css">
html {
background: none;
background-color: #f0eeee;
}
body {
padding: 0;
}
#header {
width: 952px;
margin: 0 auto;
height: 120px;
background: none;
box-shadow: none;
position: static;
}
#content {
font-family: "微软雅黑";
background: url("images/404.png") no-repeat 122px 0px;
width: 952px;
margin: 0 auto;
font-size: 18px;
color: #999;
}
#content p {
padding: 180px 0 0 426px;
line-height: 38px;
}
#content p a.backhome {
font-size: 14px;
}
#content p a.backhome span {
width: 80px;
}
</style>
</head>
<body>
<div>
<div id="content" style="height: 530px;">
<p>
对不起,您的风筝已掉线,请时光倒流回前一秒。<br>
<a href="http://mybookmark.cn" class="adaptbtn2 btn-green42 backhome"><span class="adaptbtn2">返回首页</span></a>&nbsp;&nbsp;&nbsp;&nbsp;
</p>
</div>
</div>
</body>
</html>

BIN
public/images/404.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB