update mysql node to use RED.httpAdmin
This commit is contained in:
parent
3a6ffdf52b
commit
3d78a93958
|
@ -19,7 +19,7 @@ var reconnect = RED.settings.mysqlReconnectTime || 30000;
|
|||
var mysqldb = require('mysql');
|
||||
var querystring = require('querystring');
|
||||
|
||||
RED.app.get('/MySQLdatabase/:id',function(req,res) {
|
||||
RED.httpAdmin.get('/MySQLdatabase/:id',function(req,res) {
|
||||
var credentials = RED.nodes.getCredentials(req.params.id);
|
||||
if (credentials) {
|
||||
res.send(JSON.stringify({user:credentials.user,hasPassword:(credentials.password&&credentials.password!="")}));
|
||||
|
@ -28,12 +28,12 @@ RED.app.get('/MySQLdatabase/:id',function(req,res) {
|
|||
}
|
||||
});
|
||||
|
||||
RED.app.delete('/MySQLdatabase/:id',function(req,res) {
|
||||
RED.httpAdmin.delete('/MySQLdatabase/:id',function(req,res) {
|
||||
RED.nodes.deleteCredentials(req.params.id);
|
||||
res.send(200);
|
||||
});
|
||||
|
||||
RED.app.post('/MySQLdatabase/:id',function(req,res) {
|
||||
RED.httpAdmin.post('/MySQLdatabase/:id',function(req,res) {
|
||||
var body = "";
|
||||
req.on('data', function(chunk) {
|
||||
body+=chunk;
|
||||
|
|
Loading…
Reference in New Issue