Knowledge Maxxing
← Back to topic library
Dev MaxxingIntermediateNext.js75 sec

Next.js route

A Next.js route is a URL path automatically mapped to a specific file in the project, based on that file's location within the app's folder structure.

Prerequisite: URL

What matters

Because routes are derived directly from the file system, adding a new page is usually as simple as adding a new file in the right folder, without separately configuring a router.

Example

A file at 'app/blog/page.tsx' automatically becomes accessible at the '/blog' URL path, with no separate routing configuration needed.

Common misconception

A Next.js route is not manually registered in a central routing configuration file; its path comes directly from where the file lives in the project.

Recall question

How does Next.js determine a page's URL path from the project's files?

Keywords and related concepts

Next.js routefile-based routingapp routerserver component

Related topics

Server Component
Dev MaxxingIntermediate
Route Handler
Dev MaxxingIntermediate
URL
Dev MaxxingBeginner