mirror of
https://github.com/sbender9/signalk-raymarine-autopilot.git
synced 2020-11-18 19:37:28 -08:00
user plugin.registerWithRouter
This commit is contained in:
parent
5edb73277f
commit
7e548e33a3
10
index.js
10
index.js
@ -51,10 +51,12 @@ module.exports = function(app) {
|
||||
debug("started")
|
||||
};
|
||||
|
||||
plugin.executeCommand = function(json) {
|
||||
debug("executeCommand: " + util.inspect(json, {showHidden: false, depth: null}))
|
||||
sendCommand(app, deviceid, json)
|
||||
}
|
||||
plugin.registerWithRouter = function(router) {
|
||||
router.post("/command", (req, res) => {
|
||||
sendCommand(app, deviceid, req.body)
|
||||
res.send("Executed command for plugin " + plugin.id)
|
||||
})
|
||||
}
|
||||
|
||||
plugin.stop = function() {
|
||||
debug("stopping")
|
||||
|
Loading…
x
Reference in New Issue
Block a user