mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Read error page before request logic.
This commit is contained in:
parent
992defa6c6
commit
294e107c4f
1 changed files with 2 additions and 1 deletions
|
|
@ -39,6 +39,8 @@ const ENFORCE_SSL = process.env.SERVER_SHARETRIBE_ENFORCE_SSL === 'true';
|
|||
const TRUST_PROXY = process.env.SERVER_SHARETRIBE_TRUST_PROXY || null;
|
||||
const app = express();
|
||||
|
||||
const errorPage = fs.readFileSync(path.join(buildPath, '500.html'), 'utf-8');
|
||||
|
||||
// The helmet middleware sets various HTTP headers to improve security.
|
||||
// See: https://www.npmjs.com/package/helmet
|
||||
app.use(helmet());
|
||||
|
|
@ -145,7 +147,6 @@ app.get('*', (req, res) => {
|
|||
})
|
||||
.catch(e => {
|
||||
console.error(e);
|
||||
const errorPage = fs.readFileSync(path.join(buildPath, '500.html'), 'utf-8');
|
||||
res.status(500).send(errorPage);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue