tezvyn:

File-Based Routing: Your Filesystem is Your API

Source: svelte.devintermediate

File-based routing makes your directory structure the single source of truth for your app's URLs. Creating a file at `routes/about/+page.svelte` automatically creates the `/about` page, no central config needed.

File-based routing turns your directory structure into your app's URL map, making your filesystem the single source of truth. Instead of a central config file, creating a file at `routes/about/+page.svelte` automatically generates the `/about` page. This pattern is central to frameworks like Next.js, Nuxt, and SvelteKit. The main footgun is looking for a separate routing configuration file or not understanding the special file naming conventions (like `+page` or `[slug]`) that activate the behavior.

Read the original → svelte.dev

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

File-Based Routing: Your Filesystem is Your API · Tezvyn