-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server,code-gen): combine json & multipart 'createBodyParsers' i…
…nto a single 'createBodyParser' This allows us to iterate on `R.body` & R.files` combining them in the future. BREAKING CHANGE: - Removed `createBodyParsers` use `createBodyParser` instead. - `createBodyParser` by default does not parse multipart bodies. This should be explicitly enabled with `multipart: true`. Configure its options with 'multipartOptions' to set a custom `maxFileSize` for example. - Changed the `jsonLimit` default to '5mb'. - The generated Koa router now accepts a single body parser instead of the previous body parser pair returned by 'createBodyParsers'. - The updated usage looks something like: ```js app.use( router( createBodyParser({ multipart: true, multipartOptions: { maxFileSize: 15 * 1024 * 2024, }, }) ) ); ```
- Loading branch information
Showing
20 changed files
with
188 additions
and
284 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export { getApp } from "./src/app.js"; | ||
export { createBodyParser } from "./src/middleware/body.js"; | ||
export { compose } from "./src/middleware/compose.js"; | ||
export type Application = import("./src/app").KoaApplication; | ||
export type Context<S, C, R> = import("koa").ParameterizedContext<S, C, R>; | ||
export type Middleware = import("koa").Middleware; | ||
export type Next = import("koa").Next; | ||
export type BodyParserPair = import("./src/middleware/body").BodyParserPair; | ||
export { createBodyParsers, compose } from "./src/middleware/index.js"; | ||
export { closeTestApp, createTestAppAndClient } from "./src/testing.js"; | ||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.