A folder or file in the form /docs/[...slug] will match all segments in that position (e.g., /docs/anything/here will be matched by [...slug]).
Create a app/coures/[courseId]/[...courses]/page.tsx
export default async function({params}:{params:Promise<{courseId:String,courses:String[]}>}){
const resolvedParams = await params;
const courseID = resolvedParams.courseId;
const courses = resolvedParams.courses;
return(
<div>
<div>{courseID}</div>
<div>{JSON.stringify(courses)}</div>
</div>
)
}
Use case - Recursive folders. For example