https://github.com/Koatty/koatty_payload
Payload parser for koatty.
https://github.com/Koatty/koatty_payload
middleware parser request-handler
Last synced: 6 months ago
JSON representation
Payload parser for koatty.
- Host: GitHub
- URL: https://github.com/Koatty/koatty_payload
- Owner: Koatty
- License: bsd-3-clause
- Created: 2020-11-20T02:23:30.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-08-30T07:47:56.000Z (over 2 years ago)
- Last Synced: 2024-12-11T18:13:35.734Z (about 1 year ago)
- Topics: middleware, parser, request-handler
- Language: TypeScript
- Homepage:
- Size: 1010 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# koatty_payload
Payload parser middleware for koatty.
# 使用
-----
Koatty框架默认集成了该中间件,无需引入即可使用。
项目middleware配置 config/middleware.ts:
```
// src/config/middleware.ts
export default {
list: [], // 加载的插件列表,执行顺序按照数组元素顺序
config: { // 插件配置
"PayloadMiddleware": {
"extTypes": {
"json": ['application/json'],
"form": ['application/x-www-form-urlencoded'],
"text": ['text/plain'],
"multipart": ['multipart/form-data'],
"xml": ['text/xml']
},
"limit": '20mb',
"encoding": 'utf-8',
"multiples": true,
"keepExtensions": true
}
},
};
```