Restart and update both work with restify, so put them behind POST endpoints to prevent absentminded browser requests from breaking sequences. They will need to be added to the UI in a reasonable way.

This commit is contained in:
mmcwilliams 2018-02-08 16:23:10 -05:00
parent 0cb9f79756
commit 2c40fa4e0e
1 changed files with 3 additions and 3 deletions

View File

@ -40,8 +40,8 @@ function createServer () {
app.get( '/status', rStatus)
app.post('/reset', rReset)
app.get('/update', rUpdate)
app.get('/restart', rRestart)
app.post('/update', rUpdate)
app.post('/restart', rRestart)
app.listen(PORT, () => {
@ -351,7 +351,7 @@ function rUpdate (req, res, next) {
if (err) {
log.error(err)
}
log.info(`update`, { git : stdio })
log.info(`/update`, { git : stdio })
res.send({ success : true, action : 'update', output : stdio })
res.end()
next()