add xml body parser for xml webhook support

This commit is contained in:
quansenB
2019-12-09 01:07:57 +01:00
parent 366fe861ca
commit a53d111e56
2 changed files with 6 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import {
getConnectionManager,
} from 'typeorm';
import * as bodyParser from 'body-parser';
require('body-parser-xml')(bodyParser);
import * as history from 'connect-history-api-fallback';
import * as requestPromise from 'request-promise-native';
@@ -232,6 +233,10 @@ class App {
// Support application/json type post data
this.app.use(bodyParser.json({ limit: "16mb" }));
// Support application/xml type post data
// @ts-ignore
this.app.use(bodyParser.xml({ limit: "16mb" }));
// Make sure that Vue history mode works properly
this.app.use(history({
rewrites: [