tezvyn:

How does src/routes determine routing in SvelteKit?

Source: svelte.devbeginner

WHAT IT TESTS: Filesystem routing and plus-prefix naming. ANSWER OUTLINE: src/routes mirrors URLs, folders become paths, [slug] creates dynamic params, and +page.svelte renders pages. RED FLAG: Saying routes live in a central config file, not the filesystem.

WHAT IT TESTS: Whether you understand SvelteKit's filesystem-based router and plus-prefixed route files. ANSWER OUTLINE: src/routes is the root and every folder inside creates a URL path. [bracketed] directories define dynamic parameters like /blog/hello-world. +page.svelte defines the page component, while +page.js can export a load function. RED FLAG: Describing React Router-style JSX routes or claiming routing lives in a central config file. Omitting the plus prefix suggests no SvelteKit experience.

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.

How does src/routes determine routing in SvelteKit? · Tezvyn