๐ฑ ๐ฝ๏ธ
Whiskers's Feeding Time
Nutritional care and feeding schedule
Rest Parameter Route
File:
[...activity].astro
Full URL:
/pets/cat/whiskers/care/feeding Activity path:
"feeding" โ ["feeding"]
Parsed as:
Activity: "feeding", Sub-activity: "none"
Activity Steps
1
Check food bowl
2
Measure appropriate portion
3
Provide fresh water
4
Monitor eating habits
Sub-Activities
These demonstrate deeper nested paths with rest parameters:
Try These URLs
Click these buttons to explore different care activities, or create your own URL below:
๐ฝ๏ธ Feeding โ Breakfast
๐งผ Grooming โ Brushing
๐พ Playing โ Fetch
๐ฏ Training โ Sit
๐ถ Walking โ Morning Walk
๐ Deep Nested Path
Create Your Own URL
The rest parameter [...activity] can handle any path depth. Try creating your own URL:
Examples to try:
โข feeding/dinner/special-diet
โข grooming/full-service/nail-trimming/front-paws
โข playing/outdoor/park/fetch/tennis-ball
โข feeding/dinner/special-diet
โข grooming/full-service/nail-trimming/front-paws
โข playing/outdoor/park/fetch/tennis-ball
Activity Status
โฐ
Started
Just now
๐
Progress
In progress
๐
Pet Mood
Happy
Rest Parameter Implementation
---
// File: /pets/[species]/[name]/care/[...activity].astro
const { species, name, activity } = Astro.params;
// Parse rest parameter into parts
const activityPath = activity || '';
const activityParts = activityPath.split('/').filter(Boolean);
const currentActivity = activityParts[0] || 'general';
const subActivity = activityParts[1] || null;
// This route matches:
// /pets/dog/buddy/care/feeding
// /pets/dog/buddy/care/feeding/breakfast
// /pets/dog/buddy/care/grooming/brushing
// /pets/dog/buddy/care/any/deep/nested/path
---
<h1>{pet.name}'s {currentActivity}</h1> Try These URLs
/pets/dog/buddy/care/feeding โ Basic feeding activity /pets/dog/buddy/care/feeding/breakfast โ Specific meal time /pets/dog/buddy/care/training/sit โ Specific training command