diff options
Diffstat (limited to 'ecomp-portal-FE/server/components/errors/index.js')
-rw-r--r-- | ecomp-portal-FE/server/components/errors/index.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ecomp-portal-FE/server/components/errors/index.js b/ecomp-portal-FE/server/components/errors/index.js new file mode 100644 index 00000000..4c5a57c9 --- /dev/null +++ b/ecomp-portal-FE/server/components/errors/index.js @@ -0,0 +1,20 @@ +/** + * Error responses + */ + +'use strict'; + +module.exports[404] = function pageNotFound(req, res) { + var viewFilePath = '404'; + var statusCode = 404; + var result = { + status: statusCode + }; + + res.status(result.status); + res.render(viewFilePath, function (err) { + if (err) { return res.json(result, result.status); } + + res.render(viewFilePath); + }); +}; |