Skip to content

Commit

Permalink
Replace fast_star paths with path patterns (#1369)
Browse files Browse the repository at this point in the history
fast star is no longer supporrted
  • Loading branch information
aelmardhi committed Sep 2, 2024
1 parent 4fe9ce7 commit 7086c51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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)
```

0 comments on commit 7086c51

Please sign in to comment.