Skip to content

Instantly share code, notes, and snippets.

View anabelengp's full-sized avatar

Ana Belén García anabelengp

  • Telefónica I+D
  • Madrid (Spain)
View GitHub Profile
@anabelengp
anabelengp / app.js
Created October 16, 2015 08:36
Basic server listening to fiware orion ContextBroker suscriptions
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
app.post('/temperature', function(req, res) {
var value = req.body.contextResponses[0].contextElement.attributes[0].value;
console.log("temperature updated at " + new Date());
console.log("value: " + value);