Next.js API Routes - Route handlers, middleware, edge runtime
Creates Next.js API routes with route handlers, middleware, and edge runtime support for handling HTTP methods and dynamic parameters.
/plugin marketplace add pluginagentmarketplace/custom-plugin-nextjs/plugin install custom-plugin-nextjs@pluginagentmarketplace-nextjsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/helper.pyscripts/validate.pyBuild API endpoints with Next.js Route Handlers and middleware.
// app/api/users/route.ts
import { NextResponse } from 'next/server'
export async function GET() {
const users = await db.users.findMany()
return NextResponse.json(users)
}
export async function POST(request: Request) {
const body = await request.json()
const user = await db.users.create(body)
return NextResponse.json(user, { status: 201 })
}
// app/api/users/[id]/route.ts
export async function GET(
request: Request,
{ params }: { params: { id: string } }
) {
const user = await db.users.findById(params.id)
return NextResponse.json(user)
}
// middleware.ts
export function middleware(request: NextRequest) {
const token = request.cookies.get('token')
if (!token) {
return NextResponse.redirect(new URL('/login', request.url))
}
}
This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.