You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
532 B
26 lines
532 B
4 years ago
|
var express = require('express');
|
||
|
var http = require('http');
|
||
|
|
||
|
var PORT = 8000;
|
||
|
|
||
|
|
||
|
|
||
|
var app = express();
|
||
|
app.get('/', function(req, res) {
|
||
|
var message = req.query["log"]
|
||
|
console.log(JSON.stringify(message))
|
||
|
res.send({message: message});
|
||
|
});
|
||
|
|
||
|
app.post('/', function(req, res) {
|
||
|
var message = req.body["log"]
|
||
|
console.log(JSON.stringify(message))
|
||
|
//console.log(req)
|
||
|
res.send({message: message});
|
||
|
});
|
||
|
|
||
|
http.Server(app).listen(PORT, function() {
|
||
|
console.log("HTTP server listening on port %s", PORT);
|
||
|
});
|
||
|
|