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 apps/docs/[...slug]/page.tsx


export default function({params}: {
    params: {
        slug: string[]
    }
}) {
    
    return <div>
        {JSON.stringify(params.slug)}
    </div>
}

Use case - Recursive folders. For example

https://app.100xdevs.com/courses/3/1

https://app.100xdevs.com/courses/3/1/4