Engrain by ByteRush

RCT.07.03 Mid-level

proxy.ts, route handlers and deployment

Comes up in: React, Frontend system design

This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.

What it covers

  • proxy.ts replaces middleware.ts (Next 16, Node runtime
  • middleware.ts is deprecated but still works for Edge)
  • route handlers
  • environment variables (server vs NEXT_PUBLIC_)
  • image and font optimisation
  • Turbopack default
  • deploying to Vercel vs other hosts (adapters, OpenNext for Cloudflare)

Words you will know

proxyroute handlerTurbopackadapter

What you will practise

  • auth redirect in proxy.ts

Interview questions this answers

  • What replaced middleware.ts in Next.js 16 and why?