hydra-express
Advanced tools
Comparing version 1.6.2 to 1.6.3
16
index.js
@@ -385,5 +385,17 @@ /** | ||
app.use(bodyParser.json()); | ||
app.use(bodyParser.urlencoded({extended: false})); | ||
if (this.config.cors) { | ||
app.use(cors(Object.assign({}, this.config.cors))); | ||
} else { | ||
app.use(cors()); | ||
} | ||
if (this.config.bodyParser) { | ||
let bodyParserConfig = Object.assign({json: {}, urlencoded: {extended: false}}, this.config.bodyParser); | ||
app.use(bodyParser.json(bodyParserConfig.json)); | ||
app.use(bodyParser.urlencoded(bodyParserConfig.urlencoded)); | ||
} else { | ||
app.use(bodyParser.json()); | ||
app.use(bodyParser.urlencoded({extended: false})); | ||
} | ||
this.registerMiddlewareCallback && this.registerMiddlewareCallback(); | ||
@@ -390,0 +402,0 @@ |
{ | ||
"name": "hydra-express", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "A module which wraps Hydra and ExpressJS to provide an out of the box microservice which can support API routes and handlers.", | ||
@@ -5,0 +5,0 @@ "author": { |
901015
757