BREAKING CHANGE: Route pattern syntax across cloud routes and rate-limiting now use the new path-to-regexp v8 syntax; see the [migration guide](https://github.com/parse-community/parse-server/blob/alpha/9.0.0.md) for more details.
57 lines
2.1 KiB
Markdown
57 lines
2.1 KiB
Markdown
# Parse Server 9 Migration Guide <!-- omit in toc -->
|
|
|
|
This document only highlights specific changes that require a longer explanation. For a full list of changes in Parse Server 9 please refer to the [changelog](https://github.com/parse-community/parse-server/blob/alpha/CHANGELOG.md).
|
|
|
|
---
|
|
- [Route Path Syntax and Rate Limiting](#route-path-syntax-and-rate-limiting)
|
|
---
|
|
|
|
## Route Path Syntax and Rate Limiting
|
|
Parse Server 9 standardizes the route pattern syntax across cloud routes and rate-limiting to use the new **path-to-regexp v8** style. This update introduces validation and a clear deprecation error for the old wildcard route syntax.
|
|
|
|
### Key Changes
|
|
- **Standardization**: All route paths now use the path-to-regexp v8 syntax, which provides better consistency and security.
|
|
- **Validation**: Added validation to ensure route paths conform to the new syntax.
|
|
- **Deprecation**: Old wildcard route syntax is deprecated and will trigger a clear error message.
|
|
|
|
### Migration Steps
|
|
|
|
#### Path Syntax Examples
|
|
|
|
Update your rate limit configurations to use the new path-to-regexp v8 syntax:
|
|
|
|
| Old Syntax (deprecated) | New Syntax (v8) |
|
|
|------------------------|-----------------|
|
|
| `/functions/*` | `/functions/*path` |
|
|
| `/classes/*` | `/classes/*path` |
|
|
| `/*` | `/*path` |
|
|
| `*` | `*path` |
|
|
|
|
**Before:**
|
|
```javascript
|
|
rateLimit: {
|
|
requestPath: '/functions/*',
|
|
requestTimeWindow: 10000,
|
|
requestCount: 100
|
|
}
|
|
```
|
|
|
|
**After:**
|
|
```javascript
|
|
rateLimit: {
|
|
requestPath: '/functions/*path',
|
|
requestTimeWindow: 10000,
|
|
requestCount: 100
|
|
}
|
|
```
|
|
|
|
- Review your custom cloud routes and ensure they use the new path-to-regexp v8 syntax.
|
|
- Update any rate-limiting configurations to use the new route path format.
|
|
- Test your application to ensure all routes work as expected with the new syntax.
|
|
|
|
> [!Note]
|
|
> Consult the [path-to-regexp v8 docs](https://github.com/pillarjs/path-to-regexp) and the [Express 5 migration guide](https://expressjs.com/en/guide/migrating-5.html#path-syntax) for more details on the new path syntax.
|
|
|
|
### Related Pull Request
|
|
- [#9942](https://github.com/parse-community/parse-server/pull/9942)
|