[fix] broken webapp state

This commit is contained in:
2020-05-08 11:08:34 +02:00
parent f3b50c4fea
commit de43be347f
2 changed files with 10 additions and 1 deletions

View File

@@ -19,6 +19,10 @@ export class Watcher {
this._error = error
}
public get state() {
return this._state
}
public get error() {
return this._error
}

View File

@@ -9,7 +9,12 @@ export function webappServe(watchers: Watcher[], host = 'localhost', port = 1050
webapp.use(cors())
webapp.get('/status', (req, res) => {
res.send(watchers)
res.send(watchers.map(watcher => {
return {
name: watcher.name,
state: watcher.state
}
}))
})
webapp.use('/', express.static(path.join(__dirname, '../../dist/')))