
Next.js API routes — build your first endpoint step by step
Learn how to create API routes in Next.js 15. Handle GET and POST requests, validate input, return JSON, and connect to a database. Beginner-friendly with full code examples.
Category
Learn how to use Delfy.dev with these tutorials. I'll show you how to ship faster and save time.
Articles

Learn how to create API routes in Next.js 15. Handle GET and POST requests, validate input, return JSON, and connect to a database. Beginner-friendly with full code examples.

Use Next.js middleware to protect private pages like /dashboard. Redirect unauthenticated users to sign-in, refresh sessions, and handle role-based access. Full code included.

Set up Supabase authentication in your Next.js 15 app with Google login and passwordless Magic Links. Server client, middleware, and session handling explained.

Understand .env.local, NEXT_PUBLIC_ prefix, server-only secrets, and how to set variables on Vercel. Simple explanations with examples for every scenario.

Create a Stripe Checkout session in Next.js, redirect users to the payment page, and handle the success callback. Works for one-time payments and subscriptions.

Go from localhost to production: connect GitHub, set environment variables, add your domain, and verify everything works. A step-by-step checklist for your first Vercel deployment.
Other categories