This commit is contained in:
syuilo
2017-10-07 04:30:57 +09:00
parent 6a5c6280ff
commit fffea98462
5 changed files with 66 additions and 16 deletions

View File

@@ -19,7 +19,12 @@ app.disable('x-powered-by');
app.set('etag', false);
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json({
type: ['application/json', 'text/plain']
type: ['application/json', 'text/plain'],
verify: (req, res, buf, encoding) => {
if (buf && buf.length) {
(req as any).rawBody = buf.toString(encoding || 'utf8');
}
}
}));
app.use(cors({
origin: true