create-nxtstart-app
Version:
Nxtstart is an easy to use, interactive CLI tool to bootstrap your next web-based project. The template is aimed at students to get an easy access to web development with example implementations. It is also useful for experts to speed up prototyping.
13 lines (11 loc) • 405 B
text/typescript
import { NextRequest } from 'next/server'
/**
* This endpoint is the default next js api endpoint example
* @allowedMethods GET
* @param name - the name to return in the response
* @returns body containing the name sent as a path parameter
*/
export async function GET(req: NextRequest) {
const name = req.nextUrl.searchParams.get('name')
return Response.json({ name: name }, { status: 200 })
}