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:
parent
0cb9f79756
commit
2c40fa4e0e
6
index.js
6
index.js
|
@ -40,8 +40,8 @@ function createServer () {
|
||||||
|
|
||||||
app.get( '/status', rStatus)
|
app.get( '/status', rStatus)
|
||||||
app.post('/reset', rReset)
|
app.post('/reset', rReset)
|
||||||
app.get('/update', rUpdate)
|
app.post('/update', rUpdate)
|
||||||
app.get('/restart', rRestart)
|
app.post('/restart', rRestart)
|
||||||
|
|
||||||
|
|
||||||
app.listen(PORT, () => {
|
app.listen(PORT, () => {
|
||||||
|
@ -351,7 +351,7 @@ function rUpdate (req, res, next) {
|
||||||
if (err) {
|
if (err) {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
}
|
}
|
||||||
log.info(`update`, { git : stdio })
|
log.info(`/update`, { git : stdio })
|
||||||
res.send({ success : true, action : 'update', output : stdio })
|
res.send({ success : true, action : 'update', output : stdio })
|
||||||
res.end()
|
res.end()
|
||||||
next()
|
next()
|
||||||
|
|
Loading…
Reference in New Issue