|
| 1 | +# Parse Server 9 Migration Guide <!-- omit in toc --> |
| 2 | + |
| 3 | +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). |
| 4 | + |
| 5 | +--- |
| 6 | +- [Route Path Syntax and Rate Limiting](#route-path-syntax-and-rate-limiting) |
| 7 | +--- |
| 8 | + |
| 9 | +## Route Path Syntax and Rate Limiting |
| 10 | +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. |
| 11 | + |
| 12 | +### Key Changes |
| 13 | +- **Standardization**: All route paths now use the path-to-regexp v8 syntax, which provides better consistency and security. |
| 14 | +- **Validation**: Added validation to ensure route paths conform to the new syntax. |
| 15 | +- **Deprecation**: Old wildcard route syntax is deprecated and will trigger a clear error message. |
| 16 | + |
| 17 | +### Migration Steps |
| 18 | + |
| 19 | +#### Path Syntax Examples |
| 20 | + |
| 21 | +Update your rate limit configurations to use the new path-to-regexp v8 syntax: |
| 22 | + |
| 23 | +| Old Syntax (deprecated) | New Syntax (v8) | |
| 24 | +|------------------------|-----------------| |
| 25 | +| `/functions/*` | `/functions/*path` | |
| 26 | +| `/classes/*` | `/classes/*path` | |
| 27 | +| `/*` | `/*path` | |
| 28 | +| `*` | `*path` | |
| 29 | + |
| 30 | +**Before:** |
| 31 | +```javascript |
| 32 | +rateLimit: { |
| 33 | + requestPath: '/functions/*', |
| 34 | + requestTimeWindow: 10000, |
| 35 | + requestCount: 100 |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +**After:** |
| 40 | +```javascript |
| 41 | +rateLimit: { |
| 42 | + requestPath: '/functions/*path', |
| 43 | + requestTimeWindow: 10000, |
| 44 | + requestCount: 100 |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +- Review your custom cloud routes and ensure they use the new path-to-regexp v8 syntax. |
| 49 | +- Update any rate-limiting configurations to use the new route path format. |
| 50 | +- Test your application to ensure all routes work as expected with the new syntax. |
| 51 | + |
| 52 | +> [!Note] |
| 53 | +> 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. |
| 54 | +
|
| 55 | +### Related Pull Request |
| 56 | +- [#9942](https://github.com/parse-community/parse-server/pull/9942) |
0 commit comments