Skip to content

Commit 8a8ef3a

Browse files
Copilotcubap
andcommitted
Refactor app.js maintenance mode check to use guard clause
Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
1 parent eb962d8 commit 8a8ef3a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ app.use(express.static(path.join(__dirname, 'public')))
7272
app.all('*', (req, res, next) => {
7373
if(process.env.DOWN === "true"){
7474
res.status(503).json({"message":"RERUM v1 is down for updates or maintenance at this time. We apologize for the inconvenience. Try again later."})
75+
return
7576
}
76-
else{
77-
next() //pass on to the next app.use
78-
}
77+
next() //pass on to the next app.use
7978
})
8079

8180
app.use('/', indexRouter)

0 commit comments

Comments
 (0)