mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This ensures we captured `middlewareClientMaxBodySize` in the config schema and rather than triggering a hard error, it will buffer up to the limit.
16 lines
351 B
TypeScript
16 lines
351 B
TypeScript
import { NextRequest, NextResponse } from 'next/server'
|
|
|
|
export async function POST(request: NextRequest) {
|
|
const body = await request.text()
|
|
return new NextResponse(
|
|
JSON.stringify({
|
|
message: 'Hello World',
|
|
bodySize: body.length,
|
|
}),
|
|
{
|
|
status: 200,
|
|
headers: { 'Content-Type': 'application/json' },
|
|
}
|
|
)
|
|
}
|