prepare log over HTTP
This commit is contained in:
@ -118,6 +118,12 @@ app.get('/', (req, res) => {
|
||||
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
|
||||
app.get('/wsurl', (req, res) => {
|
||||
@ -228,5 +234,5 @@ app.get('/test_ocr', (req, res) => {
|
||||
|
||||
|
||||
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);
|
||||
});
|
||||
|
Reference in New Issue
Block a user