[fix] broken webapp state
This commit is contained in:
@@ -19,6 +19,10 @@ export class Watcher {
|
||||
this._error = error
|
||||
}
|
||||
|
||||
public get state() {
|
||||
return this._state
|
||||
}
|
||||
|
||||
public get error() {
|
||||
return this._error
|
||||
}
|
||||
|
||||
@@ -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/')))
|
||||
|
||||
Reference in New Issue
Block a user