prepare log over HTTP
This commit is contained in:
parent
9435650d4f
commit
643d3dfb6f
7
.vscode/tasks.json
vendored
7
.vscode/tasks.json
vendored
@ -41,6 +41,13 @@
|
|||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"label": "npm: start",
|
"label": "npm: start",
|
||||||
"detail": "node /app/web/server.js"
|
"detail": "node /app/web/server.js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "python",
|
||||||
|
"script": "start:tele",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"label": "npm: start:tele",
|
||||||
|
"detail": "python agent-py-bot/agent.py"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -118,6 +118,12 @@ app.get('/', (req, res) => {
|
|||||||
res.sendFile(path.join(__dirname, 'client.html'));
|
res.sendFile(path.join(__dirname, 'client.html'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//accept LOG messages on /log
|
||||||
|
app.post('/log', (req, res) => {
|
||||||
|
console.log(req.body.message);
|
||||||
|
res.send('OK', 200, { 'Content-Type': 'text/plain' });
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
//get WS url from .env file
|
//get WS url from .env file
|
||||||
app.get('/wsurl', (req, res) => {
|
app.get('/wsurl', (req, res) => {
|
||||||
@ -228,5 +234,5 @@ app.get('/test_ocr', (req, res) => {
|
|||||||
|
|
||||||
|
|
||||||
app.listen(process.env.SERVER_PORT_HTTP, () => {
|
app.listen(process.env.SERVER_PORT_HTTP, () => {
|
||||||
console.log('Server listening on port ' + process.env.SERVER_PORT_HTTP + ': http://localhost:' + process.env.SERVER_PORT_HTTP + '/');
|
console.log('Server listening on port ' + process.env.SERVER_PORT_HTTP);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user