mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Remove deprecated Connect api
This commit is contained in:
parent
cbc12d783c
commit
76def0a320
@ -19,7 +19,9 @@ var util = require("util");
|
|||||||
var http = require("http");
|
var http = require("http");
|
||||||
var https = require("https");
|
var https = require("https");
|
||||||
var urllib = require("url");
|
var urllib = require("url");
|
||||||
var bodyParser = require("express").bodyParser();
|
var express = require("express");
|
||||||
|
var jsonParser = express.json();
|
||||||
|
var urlencParser = express.urlencoded();
|
||||||
|
|
||||||
function HTTPIn(n) {
|
function HTTPIn(n) {
|
||||||
RED.nodes.createNode(this,n);
|
RED.nodes.createNode(this,n);
|
||||||
@ -33,9 +35,9 @@ function HTTPIn(n) {
|
|||||||
if (this.method == "get") {
|
if (this.method == "get") {
|
||||||
RED.app.get(this.url,this.callback);
|
RED.app.get(this.url,this.callback);
|
||||||
} else if (this.method == "post") {
|
} else if (this.method == "post") {
|
||||||
RED.app.post(this.url,bodyParser,this.callback);
|
RED.app.post(this.url,jsonParser,urlencParser,this.callback);
|
||||||
} else if (this.method == "put") {
|
} else if (this.method == "put") {
|
||||||
RED.app.put(this.url,bodyParser,this.callback);
|
RED.app.put(this.url,jsonParser,urlencParser,this.callback);
|
||||||
} else if (this.method == "delete") {
|
} else if (this.method == "delete") {
|
||||||
RED.app.delete(this.url,this.callback);
|
RED.app.delete(this.url,this.callback);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user