Romaji to Kana Converter: React & Next.js — Chapter 8, Exercise 2 ===================================================================== TASK This chapter's own real test showed that GET / returns a genuine 404 once basePath is set to /romaji. A teammate is confused, since the app clearly still works -- just under a different path. Explain, precisely, what "the app's own root" actually means once basePath is configured, and why 404 is the honest, correct response rather than a bug. SOLUTION Before basePath is set, "the app's own root" and "the literal URL path /" happen to be the exact same thing, which makes it easy to accidentally think of them as inherently the same concept rather than two things that just happened to coincide. Setting basePath: '/romaji' doesn't add a second copy of the app at a new location while leaving the original one at / -- it genuinely moves where the app's own root actually is. After that change, the app's own root IS /romaji; the literal path / was never a special, permanently-reserved address for "wherever the app lives," it was just wherever the app happened to be mounted before this specific configuration changed. This chapter's own real test makes that concrete: GET /romaji returns a genuine 200 with the real homepage content, while GET / returns a genuine 404 -- not because something broke, but because there genuinely is no route registered at / anymore. The app was never listening in two places at once; it moved. Requesting the address it used to live at, now that it doesn't anymore, is structurally identical to requesting any other real, honestly nonexistent path -- a 404 is the correct, accurate answer, not a symptom of something going wrong. The real reason this feels surprising is that most day-to-day web development happens with basePath unset, where "the root" and "/" are permanently fused together by default, making it easy to internalize / as meaning "the app" specifically rather than "wherever the app currently happens to be mounted." basePath exposes that those were always two separate facts that merely lined up by default -- and once they're deliberately un-lined-up, a 404 at the old address is exactly what a correctly working, successfully moved app should honestly report. WHY THIS WORKS AS AN ANSWER ---------------------------- It distinguishes "the app's own root" (a relative concept, wherever it's currently mounted) from the literal path "/" (one specific possible value for that concept), and explains that basePath genuinely relocates the former rather than duplicating the app at a new address -- making the 404 at the old address the honest, correct outcome rather than a fault.