This is my app.js
var express = require('express');
var app = express();
var port = process.env.PORT || 8080;
var bodyParser = require('body-parser');
app.use(bodyParser.json()); // support json encoded bodies
app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies
app.post('/coords', function(req, res) {
var lat = req.body.lat,
lon = req.body.lon;**strong text**
res.send("DATA / Latitud: "+ lat +" - Longitud: "+ lon);
});
// start the server
app.listen(port);
console.log('Server start! at http://localhost:' + port);
I send 2 vars to my webservice every x seconds. I would like to pass the post data "lat" and "lon" to the client (index.html)