Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ app.use(express.static(path.join(__dirname, 'public')))
app.all('*', (req, res, next) => {
if(process.env.DOWN === "true"){
res.status(503).json({"message":"RERUM v1 is down for updates or maintenance at this time. We apologize for the inconvenience. Try again later."})
return
}
else{
next() //pass on to the next app.use
}
next() //pass on to the next app.use
})

app.use('/', indexRouter)
Expand Down
7 changes: 3 additions & 4 deletions routes/patchSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import rest from '../rest.js'
router.route('/')
.patch(auth.checkJwt, controller.patchSet)
.post(auth.checkJwt, (req, res, next) => {
if (rest.checkPatchOverrideSupport(req, res)) {
controller.patchSet(req, res, next)
}
else {
if (!rest.checkPatchOverrideSupport(req, res)) {
res.statusMessage = 'Improper request method for updating, please use PATCH to add new keys to this object.'
res.status(405)
next(res)
return
}
controller.patchSet(req, res, next)
})
.all((req, res, next) => {
res.statusMessage = 'Improper request method for updating, please use PATCH to add new keys to this object.'
Expand Down
7 changes: 3 additions & 4 deletions routes/patchUnset.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ import rest from '../rest.js'
router.route('/')
.patch(auth.checkJwt, controller.patchUnset)
.post(auth.checkJwt, (req, res, next) => {
if (rest.checkPatchOverrideSupport(req, res)) {
controller.patchUnset(req, res, next)
}
else {
if (!rest.checkPatchOverrideSupport(req, res)) {
res.statusMessage = 'Improper request method for updating, please use PATCH to remove keys from this object.'
res.status(405)
next(res)
return
}
controller.patchUnset(req, res, next)
})
.all((req, res, next) => {
res.statusMessage = 'Improper request method for updating, please use PATCH to remove keys from this object.'
Expand Down
7 changes: 3 additions & 4 deletions routes/patchUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import auth from '../auth/index.js'
router.route('/')
.patch(auth.checkJwt, controller.patchUpdate)
.post(auth.checkJwt, (req, res, next) => {
if (rest.checkPatchOverrideSupport(req, res)) {
controller.patchUpdate(req, res, next)
}
else {
if (!rest.checkPatchOverrideSupport(req, res)) {
res.statusMessage = 'Improper request method for updating, please use PATCH to alter the existing keys this object.'
res.status(405)
next(res)
return
}
controller.patchUpdate(req, res, next)
})
.all((req, res, next) => {
res.statusMessage = 'Improper request method for updating, please use PATCH to alter existing keys on this object.'
Expand Down