mirror of
https://github.com/xiaoyiweb/YiAi.git
synced 2026-04-22 11:04:27 +08:00
初始化
This commit is contained in:
13
service/src/common/middleware/xml.middleware.ts
Normal file
13
service/src/common/middleware/xml.middleware.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Injectable, NestMiddleware } from '@nestjs/common';
|
||||
import * as bodyParser from 'body-parser';
|
||||
|
||||
const bodyParserMiddleware = bodyParser.text({
|
||||
type: 'application/xml',
|
||||
});
|
||||
|
||||
@Injectable()
|
||||
export class XMLMiddleware implements NestMiddleware {
|
||||
use(req: any, res: any, next: () => void) {
|
||||
bodyParserMiddleware(req, res, next);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user