parse-server 8.0.0-alpha.3 → 8.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -12
- package/lib/Options/Definitions.js +3 -3
- package/lib/Options/docs.js +3 -3
- package/lib/Options/index.js +1 -1
- package/lib/Routers/PublicAPIRouter.js +9 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -437,8 +437,6 @@ const server = ParseServer({
|
|
|
437
437
|
|
|
438
438
|
## Custom Routes
|
|
439
439
|
|
|
440
|
-
**Caution, this is an experimental feature that may not be appropriate for production.**
|
|
441
|
-
|
|
442
440
|
Custom routes allow to build user flows with webpages, similar to the existing password reset and email verification features. Custom routes are defined with the `pages` option in the Parse Server configuration:
|
|
443
441
|
|
|
444
442
|
### Example
|
|
@@ -448,7 +446,7 @@ const api = new ParseServer({
|
|
|
448
446
|
...otherOptions,
|
|
449
447
|
|
|
450
448
|
pages: {
|
|
451
|
-
enableRouter: true,
|
|
449
|
+
enableRouter: true,
|
|
452
450
|
customRoutes: [{
|
|
453
451
|
method: 'GET',
|
|
454
452
|
path: 'custom_route',
|
|
@@ -485,7 +483,7 @@ The following paths are already used by Parse Server's built-in features and are
|
|
|
485
483
|
| Parameter | Optional | Type | Default value | Example values | Environment variable | Description |
|
|
486
484
|
|------------------------------|----------|-----------------|---------------|-----------------------|------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
487
485
|
| `pages` | yes | `Object` | `undefined` | - | `PARSE_SERVER_PAGES` | The options for pages such as password reset and email verification. |
|
|
488
|
-
| `pages.enableRouter` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_ROUTER` | Is `true` if the pages router should be enabled; this is required for any of the pages options to take effect.
|
|
486
|
+
| `pages.enableRouter` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_ROUTER` | Is `true` if the pages router should be enabled; this is required for any of the pages options to take effect. |
|
|
489
487
|
| `pages.customRoutes` | yes | `Array` | `[]` | - | `PARSE_SERVER_PAGES_CUSTOM_ROUTES` | The custom routes. The routes are added in the order they are defined here, which has to be considered since requests traverse routes in an ordered manner. Custom routes are traversed after build-in routes such as password reset and email verification. |
|
|
490
488
|
| `pages.customRoutes.method` | | `String` | - | `GET`, `POST` | - | The HTTP method of the custom route. |
|
|
491
489
|
| `pages.customRoutes.path` | | `String` | - | `custom_page` | - | The path of the custom route. Note that the same path can used if the `method` is different, for example a path `custom_page` can have two routes, a `GET` and `POST` route, which will be invoked depending on the HTTP request method. |
|
|
@@ -608,8 +606,6 @@ Assuming the script above is named, `parse_idempotency_delete_expired_records.sh
|
|
|
608
606
|
|
|
609
607
|
### Pages
|
|
610
608
|
|
|
611
|
-
**Caution, this is an experimental feature that may not be appropriate for production.**
|
|
612
|
-
|
|
613
609
|
Custom pages as well as feature pages (e.g. password reset, email verification) can be localized with the `pages` option in the Parse Server configuration:
|
|
614
610
|
|
|
615
611
|
```js
|
|
@@ -617,7 +613,7 @@ const api = new ParseServer({
|
|
|
617
613
|
...otherOptions,
|
|
618
614
|
|
|
619
615
|
pages: {
|
|
620
|
-
enableRouter: true,
|
|
616
|
+
enableRouter: true,
|
|
621
617
|
enableLocalization: true,
|
|
622
618
|
}
|
|
623
619
|
}
|
|
@@ -665,7 +661,7 @@ const api = new ParseServer({
|
|
|
665
661
|
...otherOptions,
|
|
666
662
|
|
|
667
663
|
pages: {
|
|
668
|
-
enableRouter: true,
|
|
664
|
+
enableRouter: true,
|
|
669
665
|
enableLocalization: true,
|
|
670
666
|
customUrls: {
|
|
671
667
|
passwordReset: 'https://example.com/page.html'
|
|
@@ -722,7 +718,7 @@ const api = new ParseServer({
|
|
|
722
718
|
...otherOptions,
|
|
723
719
|
|
|
724
720
|
pages: {
|
|
725
|
-
enableRouter: true,
|
|
721
|
+
enableRouter: true,
|
|
726
722
|
enableLocalization: true,
|
|
727
723
|
localizationJsonPath: './private/localization.json',
|
|
728
724
|
localizationFallbackLocale: 'en'
|
|
@@ -747,7 +743,7 @@ const api = new ParseServer({
|
|
|
747
743
|
...otherOptions,
|
|
748
744
|
|
|
749
745
|
pages: {
|
|
750
|
-
enableRouter: true,
|
|
746
|
+
enableRouter: true,
|
|
751
747
|
placeholders: {
|
|
752
748
|
exampleKey: 'exampleValue'
|
|
753
749
|
}
|
|
@@ -761,7 +757,7 @@ const api = new ParseServer({
|
|
|
761
757
|
...otherOptions,
|
|
762
758
|
|
|
763
759
|
pages: {
|
|
764
|
-
enableRouter: true,
|
|
760
|
+
enableRouter: true,
|
|
765
761
|
placeholders: async (params) => {
|
|
766
762
|
const value = await doSomething(params.locale);
|
|
767
763
|
return {
|
|
@@ -781,7 +777,7 @@ The following parameter and placeholder keys are reserved because they are used
|
|
|
781
777
|
| Parameter | Optional | Type | Default value | Example values | Environment variable | Description |
|
|
782
778
|
|-------------------------------------------------|----------|---------------------------------------|----------------------------------------|------------------------------------------------------|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
783
779
|
| `pages` | yes | `Object` | `undefined` | - | `PARSE_SERVER_PAGES` | The options for pages such as password reset and email verification. |
|
|
784
|
-
| `pages.enableRouter` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_ROUTER` | Is `true` if the pages router should be enabled; this is required for any of the pages options to take effect.
|
|
780
|
+
| `pages.enableRouter` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_ROUTER` | Is `true` if the pages router should be enabled; this is required for any of the pages options to take effect. |
|
|
785
781
|
| `pages.enableLocalization` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_LOCALIZATION` | Is true if pages should be localized; this has no effect on custom page redirects. |
|
|
786
782
|
| `pages.localizationJsonPath` | yes | `String` | `undefined` | `./private/translations.json` | `PARSE_SERVER_PAGES_LOCALIZATION_JSON_PATH` | The path to the JSON file for localization; the translations will be used to fill template placeholders according to the locale. |
|
|
787
783
|
| `pages.localizationFallbackLocale` | yes | `String` | `en` | `en`, `en-GB`, `default` | `PARSE_SERVER_PAGES_LOCALIZATION_FALLBACK_LOCALE` | The fallback locale for localization if no matching translation is provided for the given locale. This is only relevant when providing translation resources via JSON file. |
|