Description
Add a file upload middleware template supporting multipart form data. This is one of the most commonly needed API features that isn't covered by the current templates.
Why
File uploads (avatars, documents, images) are required by the majority of production APIs. Providing a template with size limits, MIME type validation, and storage abstraction (local, S3, R2) means users don't have to figure this out from scratch.
Acceptance Criteria
Implementation
```typescript
app.post('/upload', async (c) => {
const body = await c.req.parseBody();
const file = body['file'] as File;
// validate, store, respond
});
```
Description
Add a file upload middleware template supporting multipart form data. This is one of the most commonly needed API features that isn't covered by the current templates.
Why
File uploads (avatars, documents, images) are required by the majority of production APIs. Providing a template with size limits, MIME type validation, and storage abstraction (local, S3, R2) means users don't have to figure this out from scratch.
Acceptance Criteria
Implementation
```typescript
app.post('/upload', async (c) => {
const body = await c.req.parseBody();
const file = body['file'] as File;
// validate, store, respond
});
```