Skip to content

Commit

Permalink
Add proper middleware to httpAdmin route handler
Browse files Browse the repository at this point in the history
  • Loading branch information
knolleary committed May 27, 2020
1 parent e8a9936 commit 9adb40d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### 0.2.5

- Add proper middleware on httpAdmin express app

#### 0.2.4

- Update dependencies
Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const should = require('should');
const fs = require('fs');
require('should-sinon');
const request = require('supertest');
var bodyParser = require("body-parser");
const express = require("express");
const http = require('http');
const stoppable = require('stoppable');
Expand Down Expand Up @@ -201,6 +202,9 @@ class NodeTestHelper extends EventEmitter {

const redNodes = this._redNodes;
this._httpAdmin = express();
this._httpAdmin.use(bodyParser.json({limit:'5mb'}));
this._httpAdmin.use(bodyParser.urlencoded({limit:'5mb',extended:true}));

const mockRuntime = {
nodes: redNodes,
events: this._events,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-node-test-helper",
"version": "0.2.4",
"version": "0.2.5",
"description": "A test framework for Node-RED nodes",
"main": "index.js",
"scripts": {
Expand All @@ -14,6 +14,7 @@
},
"dependencies": {
"express": "4.17.1",
"body-parser": "1.19.0",
"read-pkg-up": "7.0.1",
"semver": "7.3.2",
"should": "^13.2.3",
Expand Down

0 comments on commit 9adb40d

Please sign in to comment.