projects
/
YouAndWeb_TwoToc
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
TwoToc code
[YouAndWeb_TwoToc]
/
server
/
components
/
errors
/
index.js
1
/**
2
* Error responses
3
*/
4
5
'use strict';
6
7
module.exports[404] = function pageNotFound(req, res) {
8
var viewFilePath = '404';
9
var statusCode = 404;
10
var result = {
11
status: statusCode
12
};
13
14
res.status(result.status);
15
res.render(viewFilePath, {}, function(err, html) {
16
if (err) {
17
return res.json(result, result.status);
18
}
19
20
res.send(html);
21
});
22
};