Closed tiagopazhs closed 2 weeks ago
➜ src git:(IS-02/create-real-time-reception-endpoint) ✗ curl -X POST http://localhost:3000/sensor-data \
-H 'Content-Type: application/json' \
-d '{
"equipmentId": "EQ-12495",
"timestamp": "2023-02-15T01:30:00.000-05:00",
"value": 78.42
}'
{"message":"Data received"}%
Received data: {
equipmentId: 'EQ-12495',
timestamp: '2023-02-15T01:30:00.000-05:00',
value: 78.42
}
Description
Develop an API endpoint using Node.js and Express to receive sensor data in JSON format and store it in the database. The endpoint should accept POST requests with the following payload format: