Recall & Review
beginner
What is file-based routing in Svelte?
File-based routing means the app creates routes automatically based on the file names and folder structure inside the
src/routes folder.Click to reveal answer
beginner
How does SvelteKit map a file named
src/routes/about/+page.svelte to a URL?The file
about/+page.svelte becomes the page at URL /about automatically.Click to reveal answer
intermediate
What does a file named
[id]/+page.svelte inside src/routes represent?It represents a dynamic route where
id is a variable part of the URL, like /123 or /abc.Click to reveal answer
beginner
How do nested folders inside
src/routes affect routing?Nested folders create nested URL paths. For example,
src/routes/blog/post/+page.svelte maps to /blog/post.Click to reveal answer
beginner
What special file name is used to create the homepage in SvelteKit?
The file
src/routes/+page.svelte creates the homepage at /.Click to reveal answer
In SvelteKit, what URL does
src/routes/contact/+page.svelte map to?✗ Incorrect
+page.svelte files inside src/routes map directly to URLs matching their folder path.What does a file named
[slug]/+page.svelte inside src/routes/blog represent?✗ Incorrect
Square brackets create dynamic routes where the part inside brackets is a variable.
How do you create a nested route for
/shop/products in SvelteKit?✗ Incorrect
Nested folders with
+page.svelte create nested routes. For example, src/routes/shop/products/+page.svelte maps to /shop/products.Which file creates the homepage route
/ in SvelteKit?✗ Incorrect
+page.svelte in the root routes folder creates the homepage.What happens if you add a file named
about/+page.svelte inside src/routes?✗ Incorrect
The
+page.svelte file inside a folder defines the page for that folder's route.Explain how file names and folder structure inside
src/routes define the URLs in SvelteKit.Think about how a website's pages are organized like folders and files on your computer.
You got /4 concepts.
Describe how you would create a dynamic blog post page that shows different posts based on the URL.
Imagine the URL changes but the page layout stays the same.
You got /4 concepts.