EraCode practice
Inject a request-scoped value with Next.js Middleware + header()
Next.jsintermediateMulti-Part
Summary
Practice lightweight dependency injection in Next.js by pushing a value into the request context (via a header) and consuming it in a Server Component.
Problem preview
### Goal Inject a request-scoped and read it in a Server Component. - Middleware should ensure every request has an header (use an existing one if present; otherwise generate one). - The Server Compo…
Attempt this challenge
Sign in to attempt the full challenge with timed AI grading, hints, and test feedback.