# API Routes de Next.js (React / Next.js) > Route Handlers, solicitudes GET/POST, middleware, CORS, autenticación, manejo de errores - 20 preguntas de entrevista - Mid-Level - [Preguntas de entrevista: React / Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista.md) ## 1. ¿Qué es un Route Handler en Next.js 13+ con el App Router? **Respuesta** Un Route Handler es una función del servidor en un archivo route.ts (o route.js) que permite crear endpoints API personalizados. A diferencia de las API Routes del Pages Router (carpeta pages/api), los Route Handlers se ubican en la carpeta app/ y soportan Web Standard Request/Response. Permiten manejar solicitudes HTTP (GET, POST, PUT, DELETE, etc.) del lado del servidor. ## 2. ¿Cómo crear un Route Handler para manejar una solicitud GET? **Respuesta** Para manejar una solicitud GET, se debe exportar una función async llamada GET en un archivo route.ts. Esta función recibe un objeto Request y retorna una Response usando NextResponse.json(). Next.js mapea automáticamente la función GET exportada a las solicitudes HTTP GET en esa ruta. Los demás métodos HTTP (POST, PUT, DELETE, PATCH) siguen el mismo patrón con sus respectivos nombres. ## 3. ¿Cuál es la diferencia entre NextResponse y Response estándar? **Respuesta** NextResponse extiende la clase Response estándar de la Web con funcionalidades específicas de Next.js. Ofrece métodos prácticos como NextResponse.json() para la serialización automática, NextResponse.redirect() para redirecciones, y facilita la manipulación de cookies y headers. Aunque Response estándar funciona, se recomienda NextResponse porque simplifica el código y ofrece una mejor integración con el ecosistema de Next.js. ## 17 preguntas más disponibles - ¿Cómo obtener los parámetros de búsqueda (query params) en un Route Handler? - ¿Cómo manejar una solicitud POST y obtener el body JSON? Regístrate gratis: https://sharpskill.dev/es/login ## Otros temas de entrevista React / Next.js - [Fundamentos de JavaScript](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/javascript-essentials.md): 25 preguntas, Junior - [Fundamentos de React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-fundamentals.md): 20 preguntas, Junior - [React Hooks](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-hooks.md): 22 preguntas, Junior - [Ciclo de vida de los componentes](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/component-lifecycle.md): 18 preguntas, Junior - [React Router](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-router.md): 20 preguntas, Junior - [Gestión de estado con Context](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/state-management-context.md): 18 preguntas, Junior - [Formularios y Controlled Components](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/forms-controlled-components.md): 20 preguntas, Mid-Level - [Obtención de datos y API](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/fetching-data-api.md): 20 preguntas, Mid-Level - [React Query (TanStack Query)](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-query-tanstack.md): 20 preguntas, Mid-Level - [Styling & CSS-in-JS](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/styling-css-in-js.md): 18 preguntas, Mid-Level - [Fundamentos de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-fundamentals.md): 25 preguntas, Mid-Level - [TypeScript con React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/typescript-react.md): 20 preguntas, Mid-Level - [Data Fetching en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-data-fetching.md): 24 preguntas, Mid-Level - [Server Actions de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-server-actions.md): 20 preguntas, Mid-Level - [Routing y Navegación en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-routing-navigation.md): 22 preguntas, Mid-Level - [Metadata & SEO en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-metadata-seo.md): 18 preguntas, Mid-Level - [Middleware y Auth en Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-middleware-auth.md): 22 preguntas, Mid-Level - [Testing en React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-testing.md): 20 preguntas, Mid-Level - [Zustand State Management](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/zustand-state-management.md): 18 preguntas, Mid-Level - [Optimización de Rendimiento en React](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-performance-optimization.md): 22 preguntas, Senior - [Error Boundaries & Error Handling](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-error-boundaries.md): 18 preguntas, Senior - [Advanced React Patterns](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/advanced-react-patterns.md): 20 preguntas, Senior - [Características avanzadas de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-advanced-features.md): 24 preguntas, Senior - [Despliegue y Producción de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-deployment-production.md): 20 preguntas, Senior - [Architecture & Design Patterns](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-architecture-patterns.md): 22 preguntas, Senior - [React Server Components](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-server-components.md): 26 preguntas, Senior - [Internacionalización de Next.js](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-internationalization.md): 20 preguntas, Senior - [React Security & Buenas Prácticas](https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/react-security-best-practices.md): 22 preguntas, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/es/technologies/react-next/preguntas-entrevista/nextjs-api-routes