๐Ÿฑ ๐Ÿฝ๏ธ

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:

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

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