pluginagentmarketplace/custom-plugin-nextjs · Archived

api-routes

Next.js API Routes - Route handlers, middleware, edge runtime

First seen Jan 26, 2026

Installation

$ npx skills add pluginagentmarketplace/custom-plugin-nextjs --skill api-routes

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from pluginagentmarketplace/custom-plugin-nextjs.

npx skills add pluginagentmarketplace/custom-plugin-nextjs

Browse all from pluginagentmarketplace/custom-plugin-nextjs

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 2
License LICENSE
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,335 B
  • docs SUMMARY.md 79 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 6 installs

SKILL.md

Api Routes Skill

Overview

Build API endpoints with Next.js Route Handlers and middleware.

Capabilities

  • Route Handlers: app/api/route.ts files
  • HTTP Methods: GET, POST, PUT, DELETE, PATCH
  • Request/Response: Web API standard
  • Middleware: Edge runtime processing
  • Dynamic Routes: [param] patterns

Examples

// 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 Example

// middleware.ts
export function middleware(request: NextRequest) {
  const token = request.cookies.get('token')
  if (!token) {
    return NextResponse.redirect(new URL('/login', request.url))
  }
}