Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace fast_star paths with path patterns #1369

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions _includes/api/en/5x/app-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ can perform a task, then call `next()` to continue matching subsequent
routes.

```js
app.all('*', requireAuthentication, loadUser)
app.all('(.*)', requireAuthentication, loadUser)
```

Or the equivalent:

```js
app.all('*', requireAuthentication)
app.all('*', loadUser)
app.all('(.*)', requireAuthentication)
app.all('(.*)', loadUser)
```

Another example is white-listed "global" functionality.
The example is similar to the ones above, but it only restricts paths that start with
"/api":

```js
app.all('/api/*', requireAuthentication)
app.all('/api/(.*)', requireAuthentication)
```
8 changes: 4 additions & 4 deletions _includes/api/en/5x/router-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ can perform a task, then call `next()` to continue matching subsequent
routes.

```js
router.all('*', requireAuthentication, loadUser)
router.all('(.*)', requireAuthentication, loadUser)
```

Or the equivalent:

```js
router.all('*', requireAuthentication)
router.all('*', loadUser)
router.all('(.*)', requireAuthentication)
router.all('(.*)', loadUser)
```

Another example of this is white-listed "global" functionality. Here
the example is much like before, but it only restricts paths prefixed with
"/api":

```js
router.all('/api/*', requireAuthentication)
router.all('/api/(.*)', requireAuthentication)
```