#global Response constructor next 13
1 messages · Page 1 of 1 (latest)
Hi @ionic wadi. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
In Next.js 13, you can set the status code directly in the Response constructor. Here's an example:
import { NextRequest, NextResponse } from 'next/server';
export async function handler(req: NextRequest) {
// Your logic here
return new NextResponse('Hello, Next.js!', {
status: 200, // Set the status code here
});
}
This example is based on the information provided in the Next.js 13.2 blog post (https://nextjs.org/blog/next-13-2).
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@ionic wadi kapa.ai is still learning and improving, please let us how it did by reacting below
example make a request to other services in /api/ folder route.ts in beta nextjs 13
@wild python example make a request to other services in /api/ folder route.ts in beta nextjs 13
Let me check the knowledge base for you. One moment! :books: