next js status code
Unanswered
American Shorthair posted this in #help-forum
American ShorthairOP
how to return status code in next js api?
4 Replies
American ShorthairOP
Please ping when reply
Rhinelander
pages router api route or app router route handler?
Sun bear
@American Shorthair
export async function GET(req: Request) {
// ... get logic
return NextResponse.json({
ok: true,
data: ...
}, {
status: 200
})
}