removed body-parser package, now using express.json
This commit is contained in:
parent
8ea029fec2
commit
1155bef544
2 changed files with 2 additions and 4 deletions
5
index.js
5
index.js
|
@ -24,10 +24,9 @@ types.DeviceRegistry.register(new types.devices.BirdySlim())
|
||||||
types.DeviceRegistry.register(new types.devices.Skyper())
|
types.DeviceRegistry.register(new types.devices.Skyper())
|
||||||
|
|
||||||
const express = require('express')
|
const express = require('express')
|
||||||
const bodyParser = require('body-parser')
|
|
||||||
const app = express()
|
const app = express()
|
||||||
app.use(bodyParser.json())
|
app.use(express.json())
|
||||||
/*app.get('/api/message/easy', async (req, res) => {})*/
|
|
||||||
app.post('/api/message/advanced', async (req, res) => {
|
app.post('/api/message/advanced', async (req, res) => {
|
||||||
if (!req.body.type) return res.status(500).json("ERROR: no msg type(simple,duplex)")
|
if (!req.body.type) return res.status(500).json("ERROR: no msg type(simple,duplex)")
|
||||||
if (!req.body.payload) return res.status(500).json("ERROR: no msg payload")
|
if (!req.body.payload) return res.status(500).json("ERROR: no msg payload")
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
"amqplib": "^0.7.0",
|
"amqplib": "^0.7.0",
|
||||||
"async-mqtt": "^2.6.1",
|
"async-mqtt": "^2.6.1",
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"body-parser": "^1.19.0",
|
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"md5": "^2.3.0",
|
"md5": "^2.3.0",
|
||||||
"mqtt": "^4.2.6"
|
"mqtt": "^4.2.6"
|
||||||
|
|
Loading…
Add table
Reference in a new issue