Skip to content

Commit

Permalink
Merge pull request #53 from christyfernandes/cbrelease-4.8.16.2
Browse files Browse the repository at this point in the history
Task #0000: 404 page for local node server
  • Loading branch information
christyfernandes authored Aug 30, 2024
2 parents 65006e1 + 0e39118 commit 444cc7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"license": "ISC",
"dependencies": {
"connect-timeout": "^1.9.0",
"ejs": "^3.1.10",
"express": "^4.16.4",
"express-static-gzip": "2.0.3",
"helmet": "^3.15.0",
Expand Down
7 changes: 5 additions & 2 deletions dist/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ app.use('/healthcheck', healthcheck({
},
}))

app.engine('html', require('ejs').renderFile);

// Add required helmet configurations
app.use(
helmet({
Expand Down Expand Up @@ -82,8 +84,9 @@ uiHostCreator('/ja', 'ja')
uiHostCreator('', 'en')
app.use(haltOnTimedOut)

app.use(function(req, res, next){
res.status(404).render('./404.html')
app.use((err, req, res, next) => {
//check what error happened here ...
res.status(404).render(path.join(__dirname, `404.html`))
})

const port = CONSTANTS.PORTAL_PORT
Expand Down

0 comments on commit 444cc7e

Please sign in to comment.