mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Move to express 4.x
This commit is contained in:
@@ -81,13 +81,13 @@ module.exports = function(RED) {
|
||||
if (node != null) {
|
||||
try {
|
||||
node.receive();
|
||||
res.send(200);
|
||||
res.sendStatus(200);
|
||||
} catch(err) {
|
||||
res.send(500);
|
||||
res.sendStatus(500);
|
||||
node.error(RED._("inject.failed",{error:err.toString()}));
|
||||
}
|
||||
} else {
|
||||
res.send(404);
|
||||
res.sendStatus(404);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -142,15 +142,15 @@ module.exports = function(RED) {
|
||||
if (node !== null && typeof node !== "undefined" ) {
|
||||
if (state === "enable") {
|
||||
node.active = true;
|
||||
res.send(200);
|
||||
res.sendStatus(200);
|
||||
} else if (state === "disable") {
|
||||
node.active = false;
|
||||
res.send(201);
|
||||
res.sendStatus(201);
|
||||
} else {
|
||||
res.send(404);
|
||||
res.sendStatus(404);
|
||||
}
|
||||
} else {
|
||||
res.send(404);
|
||||
res.sendStatus(404);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user