File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -205,6 +205,27 @@ const app = createApp().post(
205205);
206206```
207207
208+ #### Request Body Utils
209+
210+ - ` FormDataBody ` : Upload ` FormData ` instances
211+ - ` UploadFileBody ` : Use ` FormData ` to upload a single file
212+ - ` UploadFilesBody ` : Use ` FormData ` to upload multiple files
213+
214+ Here's an example:
215+
216+ ``` ts
217+ import { createApp } from " @aklinker1/zeta" ;
218+ import { UploadFilesBody } from " @aklinker1/zeta/schema" ;
219+
220+ const app = createApp ().post (" /upload" , {
221+ body: UploadFilesBody ,
222+ }, ({ body }) => {
223+ console .log (body ); // File[]
224+ });
225+ ```
226+
227+ For all the body utils, just pass them to the ` body ` property and inside the route handler, the ` body ` variable will be typed accordingly.
228+
208229### Response
209230
210231You can either define a single response or multiple responses.
You can’t perform that action at this time.
0 commit comments