coronado-bridge
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -53,3 +53,3 @@ "use strict"; | ||
// these are all set to defaults per the docs. | ||
app.use(express_1.default.json()); // content-type: application/json | ||
app.use(express_1.default.json(this.config.jsonParsingOptions)); // content-type: application/json | ||
app.use(express_1.default.text()); // content-type: text/plain | ||
@@ -56,0 +56,0 @@ // Notice we support the IBridgeConfig passing in cors options |
@@ -0,3 +1,5 @@ | ||
/// <reference types="node" /> | ||
import CoronadoBridge from './bridge'; | ||
import { ILogger } from './types'; | ||
import * as http from 'http'; | ||
import { IOutboundProvider, IProviderReq } from './provider'; | ||
@@ -12,4 +14,19 @@ import BridgeError from './bridge-error'; | ||
corsOptions?: object; | ||
jsonParsingOptions?: { | ||
/** When set to true, then deflated (compressed) bodies will be inflated; when false, deflated bodies are rejected. Defaults to true. */ | ||
inflate?: boolean; | ||
/** | ||
* Controls the maximum request body size. If this is a number, | ||
* then the value specifies the number of bytes; if it is a string, | ||
* the value is passed to the bytes library for parsing. Defaults to '100kb'. | ||
*/ | ||
limit?: number | string; | ||
/** | ||
* The type option is used to determine what media type the middleware will parse | ||
* Default: application/json | ||
*/ | ||
type?: string | string[] | ((req: http.IncomingMessage) => any); | ||
}; | ||
} | ||
export default CoronadoBridge; | ||
export { IOutboundProvider, IProviderReq, BridgeError, OutboundResponse }; |
{ | ||
"name": "coronado-bridge", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Coronado Bridge is a simple general purpose router of all HTTP requests. It will wrap all RESTful calls from external systems and pass those JSON message into a outbound provider.", | ||
@@ -23,3 +23,4 @@ "main": "dist/index.js", | ||
"cors": "^2.8.5", | ||
"express": "^4.17.1" | ||
"express": "^4.17.1", | ||
"simple-mock": "^0.8.0" | ||
}, | ||
@@ -34,2 +35,3 @@ "devDependencies": { | ||
"@types/node": "^16.7.4", | ||
"@types/simple-mock": "^0.8.2", | ||
"chai": "^4.3.4", | ||
@@ -36,0 +38,0 @@ "chai-http": "^4.3.0", |
34610
340
4
17
+ Addedsimple-mock@^0.8.0
+ Addedsimple-mock@0.8.0(transitive)