Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var express = require('express');
- var app = express();
- .......
- app.use(express.json());
- app.use(express.urlencoded()); // THIS SHOULD WORK!
- ......
- sensorRoute.post('/', (req, res, next) => {
- console.log(req.body);
- const temperature = req.body.temperature;
- console.log(temperature);
- if (!temperature) {
- return res.status(400).send({'res': 'Missing data'});
- } else {
- return res.status(200).send({'res': 'OK'});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement