Skip to content

Commit

Permalink
add fix for using older companion module version
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdadams committed May 31, 2023
1 parent 7c04db4 commit bd2dc09
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
18 changes: 8 additions & 10 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,19 @@ class API {
server.post('/sendmidi', function (req, res) {
let midiObj = req.body;

function sendResult(json) {
res.send(json);
}

util.sendMIDI(midiObj, sendResult);
util.sendMIDI(midiObj, function(result) {
let commandname = midiObj.midicommand + '-sent-successfully'; //this is just a hack for older versions
res.send({result: commandname});
});
});

server.get('/sendmidi', function (req,res) {
let midiObj = req.query;

function sendResult(json) {
res.send(json);
}

util.sendMIDI(midiObj, sendResult);
util.sendMIDI(midiObj, function(result) {
let commandname = midiObj.midicommand + '-sent-successfully'; //this is just a hack for older versions
res.send({result: commandname});
});
});

server.use(function (req, res) {
Expand Down
1 change: 1 addition & 0 deletions midi.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function sendMIDI(midiObj, callback) {
}
}
returnObj = {result: 'midi-sent-successfully', midiObj: midiObj, message: rawmessage};
console.log(returnObj);
callback(returnObj);
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "midi-relay",
"productName": "midi-relay",
"version": "3.0.4",
"version": "3.0.5",
"description": "Listens for HTTP requests with JSON payload and relays MIDI/MSC commands on local ports.",
"license": "MIT",
"repository": "josephdadams/midi-relay",
Expand Down

0 comments on commit bd2dc09

Please sign in to comment.