Skip to content

Commit

Permalink
fix: Add configure pages router option
Browse files Browse the repository at this point in the history
  • Loading branch information
cbaker6 committed Jan 20, 2025
1 parent 409d336 commit eb9d743
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@
"description": "If set to `true`, a `Parse.Object` that is in the payload when calling a Cloud Function will be converted to an instance of `Parse.Object`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Object` but is not an actual instance of `Parse.Object`. Default is `false`. The expected behavior would be that the object is converted to an instance of `Parse.Object`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where JavaScript objects are not converted to actual instances of `Parse.Object`.",
"value": "true"
},
"PARSE_SERVER_PAGES_ENABLE_ROUTER": {
"description": "Is true if the pages router should be enabled; this is required for any of the pages options to take effect.",
"value": "true"
},
"PARSE_SERVER_DIRECT_ACCESS": {
"description": "WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres.",
"value": "false"
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_PAGES_ENABLE_ROUTER": 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'true' # If you are not using ParseCareKit, set this to 'false'
Expand Down
1 change: 1 addition & 0 deletions docker-compose.mongo.dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_PAGES_ENABLE_ROUTER": 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'true' # If you are not using ParseCareKit, set this to 'false'
Expand Down
1 change: 1 addition & 0 deletions docker-compose.mongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_PAGES_ENABLE_ROUTER": 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'true' # If you are not using ParseCareKit, set this to 'false'
Expand Down
1 change: 1 addition & 0 deletions docker-compose.no.hipaa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_PAGES_ENABLE_ROUTER": 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'false' # If you are not using ParseCareKit, set this to 'false'
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ services:
PARSE_SERVER_ALLOW_CUSTOM_OBJECTID: 'true' # Required to be true for ParseCareKit
PARSE_SERVER_ENABLE_SCHEMA_HOOKS: 'true'
PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION: 'true'
PARSE_SERVER_PAGES_ENABLE_ROUTER": 'true'
PARSE_SERVER_DIRECT_ACCESS: 'false' # WARNING: Setting to 'true' is known to cause crashes on parse-hipaa running postgres
PARSE_SERVER_ENABLE_PRIVATE_USERS: 'true'
PARSE_SERVER_USING_PARSECAREKIT: 'true' # If you are not using ParseCareKit, set this to 'false'
Expand Down
10 changes: 10 additions & 0 deletions parse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ if (process.env.PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION == 'true') {
encodeParseObjectInCloudFunction = true
}

let enablePagesRouter = false;
if (process.env.PARSE_SERVER_PAGES_ENABLE_ROUTER == 'true') {
enablePagesRouter = true
}

const pagesOptions = {
enableRouter: enablePagesRouter,
};

let useDirectAccess = false;
if (process.env.PARSE_SERVER_DIRECT_ACCESS == 'true') {
useDirectAccess = true
Expand Down Expand Up @@ -299,6 +308,7 @@ configuration = {
enforcePrivateUsers: enforcePrivateUsers,
jsonLogs: jsonLogs,
logsFolder: logsFolder,
pages: pagesOptions,
preserveFileName: preserveFileName,
revokeSessionOnPasswordReset: revokeSessionOnPasswordReset,
sessionLength: sessionLength,
Expand Down

0 comments on commit eb9d743

Please sign in to comment.