Changeset View
Changeset View
Standalone View
Standalone View
support/aphlict/server/aphlict_server.js
| Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | request.on('end', function() { | ||||
| var msg = JSON.parse(body); | var msg = JSON.parse(body); | ||||
| debug.log('notification: ' + JSON.stringify(msg)); | debug.log('notification: ' + JSON.stringify(msg)); | ||||
| ++messages_in; | ++messages_in; | ||||
| transmit(msg); | transmit(msg); | ||||
| response.writeHead(200, {'Content-Type': 'text/plain'}); | response.writeHead(200, {'Content-Type': 'text/plain'}); | ||||
| } catch (err) { | } catch (err) { | ||||
| debug.log( | |||||
| '<%s> Bad Request! %s', | |||||
| request.socket.remoteAddress, | |||||
| err); | |||||
| response.statusCode = 400; | response.statusCode = 400; | ||||
| response.write('400 Bad Request'); | response.write('400 Bad Request'); | ||||
| } finally { | } finally { | ||||
| response.end(); | response.end(); | ||||
| } | } | ||||
| }); | }); | ||||
| } else if (request.url == '/status/') { | } else if (request.url == '/status/') { | ||||
| request.on('data', function() { | request.on('data', function() { | ||||
| ▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines | |||||