docs([[...rest]]): add experimental banner (#13641)

This feature is still experimental.
This commit is contained in:
Joe Haddad 2020-06-01 18:51:57 -04:00 committed by GitHub
parent ad24a0c855
commit f49309a92e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -82,6 +82,9 @@ Now, a request to `/api/post/a/b/c` will respond with the text: `Post: a, b, c`.
### Optional catch all API routes ### Optional catch all API routes
> **Warning**: This feature is **experimental and may not work as expected**.
> You must enable the `optionalCatchAll` experimental option to try it.
Catch all routes can be made optional by including the parameter in double brackets (`[[...slug]]`). Catch all routes can be made optional by including the parameter in double brackets (`[[...slug]]`).
For example, `pages/api/post/[[...slug]].js` will match `/api/post`, `/api/post/a`, `/api/post/a/b`, and so on. For example, `pages/api/post/[[...slug]].js` will match `/api/post`, `/api/post/a`, `/api/post/a/b`, and so on.

View file

@ -87,6 +87,9 @@ And in the case of `/post/a/b`, and any other matching path, new parameters will
### Optional catch all routes ### Optional catch all routes
> **Warning**: This feature is **experimental and may not work as expected**.
> You must enable the `optionalCatchAll` experimental option to try it.
Catch all routes can be made optional by including the parameter in double brackets (`[[...slug]]`). Catch all routes can be made optional by including the parameter in double brackets (`[[...slug]]`).
For example, `pages/post/[[...slug]].js` will match `/post`, `/post/a`, `/post/a/b`, and so on. For example, `pages/post/[[...slug]].js` will match `/post`, `/post/a`, `/post/a/b`, and so on.