Loading video player...
๐ Learning : app/api/*/route.ts โ GET, POST, PUT, DELETE handlers. When to use Route Handlers vs Server Actions (public APIs, webhooks, third-party integrations vs internal mutations). Request/Response objects, headers, cookies. Streaming responses. ๐ Hands-On : Create app/api/posts/route.ts (GET all, POST new). Create app/api/posts/[id]/route.ts (GET one, PUT, DELETE). Test with Postman/Thunder Client. Add proper error handling and status codes. ๐งช Mini-Project : "REST API for Posts" โ A complete REST API for blog posts with pagination (?page=1&limit=10), search (?q=nextjs), and sorting. Document the endpoints in a README.