Repository navigation
I am unable to use json format to start parse-server #1358
Copy link
Copy link
Closed
Description
I am unable to use json format to start parse-server.
Execution log
parse-server GowriDev$ parse-server myConfig.json
Configuation loaded from /Users/GowriDev/ParseWork/parse-server/myConfig.json
Usage: parse-server [options] <path/to/configuration.json>
Options:
-h, --help output usage information
--appId <appId> Your Parse Application ID
--masterKey <masterKey> Your Parse Master Key
--port [port] The port to run the ParseServer. defaults to 1337.
--databaseURI [databaseURI] The full URI to your mongodb database
--serverURL [serverURL] URL to your parse server with http:// or https://.
--clientKey [clientKey] Key for iOS, MacOS, tvOS clients
--javascriptKey [javascriptKey] Key for the Javascript SDK
--restAPIKey [restAPIKey] Key for REST calls
--dotNetKey [dotNetKey] Key for Unity and .Net SDK
--cloud [cloud] Full path to your cloud code main.js
--push [push] Configuration for push, as stringified JSON. See https://github.com/ParsePlatform/parse-server/wiki/Push
--oauth [oauth] Configuration for your oAuth providers, as stringified JSON. See https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide#oauth
--fileKey [fileKey] Key for your files
--facebookAppIds [facebookAppIds] Comma separated list for your facebook app Ids
--enableAnonymousUsers [enableAnonymousUsers] Enable (or disable) anon users, defaults to true
--allowClientClassCreation [allowClientClassCreation] Enable (or disable) client class creation, defaults to true
--mountPath [mountPath] Mount path for the server, defaults to /parse
--databaseAdapter [databaseAdapter] Adapter module for the database sub-system
--filesAdapter [filesAdapter] Adapter module for the files sub-system
--loggerAdapter [loggerAdapter] Adapter module for the logging sub-system
--maxUploadSize [maxUploadSize] Max file size for uploads.
Configure From Environment:
$ PARSE_SERVER_APPLICATION_ID='appId'
$ PARSE_SERVER_MASTER_KEY='masterKey'
$ PORT='port'
$ PARSE_SERVER_DATABASE_URI='databaseURI'
$ PARSE_SERVER_URL='serverURL'
$ PARSE_SERVER_CLIENT_KEY='clientKey'
$ PARSE_SERVER_JAVASCRIPT_KEY='javascriptKey'
$ PARSE_SERVER_REST_API_KEY='restAPIKey'
$ PARSE_SERVER_DOT_NET_KEY='dotNetKey'
$ PARSE_SERVER_CLOUD_CODE_MAIN='cloud'
$ PARSE_SERVER_PUSH='push'
$ PARSE_SERVER_OAUTH_PROVIDERS='oauth'
$ PARSE_SERVER_FILE_KEY='fileKey'
$ PARSE_SERVER_FACEBOOK_APP_IDS='facebookAppIds'
$ PARSE_SERVER_ENABLE_ANON_USERS='enableAnonymousUsers'
$ PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION='allowClientClassCreation'
$ PARSE_SERVER_MOUNT_PATH='mountPath'
$ PARSE_SERVER_DATABASE_ADAPTER='databaseAdapter'
$ PARSE_SERVER_FILES_ADAPTER='filesAdapter'
$ PARSE_SERVER_LOGGER_ADAPTER='loggerAdapter'
$ PARSE_SERVER_MAX_UPLOAD_SIZE='maxUploadSize'
Get Started guide:
Please have a look at the get started guide!
https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide
Usage with npm start
$ npm start -- path/to/config.json
$ npm start -- --appId APP_ID --masterKey MASTER_KEY --serverURL serverURL
$ npm start -- --appId APP_ID --masterKey MASTER_KEY --serverURL serverURL
Usage:
$ parse-server path/to/config.json
$ parse-server -- --appId APP_ID --masterKey MASTER_KEY --serverURL serverURL
$ parse-server -- --appId APP_ID --masterKey MASTER_KEY --serverURL serverURL
ERROR: appId and masterKey are requiredI am referring to this statement in Readme file
"You may pass these as parameters when running a standalone parse-server, or by loading a configuration file in JSON format using parse-server path/to/configuration.json. "
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
flovilmart commentedon Apr 4, 2016
That's odd, did you set appId and masterKey in your json? Can you post your JSON?
flovilmart commentedon Apr 4, 2016
your config.json should look like that:
gowridev commentedon Apr 5, 2016
Thank you ,its working now.(using variable names as appId,masterKey,..)
Sorry, I forgot to share the JSON the file. Can we give environment variables in the JSON file?
{
"PARSE_SERVER_APPLICATION_ID" : "9vEs0Z6di8uzmPsqr1I3678",
"PARSE_SERVER_MASTER_KEY" : "9O54LhBKV8oBg0th6Nhyzs",
"PARSE_SERVER_PARSE_MOUNT" : "/parse",
"PARSE_SERVER_REST_KEY" : "TAStOctHQNSeE4AS135Gdf",
"PARSE_SERVER_DATABASE_URI" : "mongodb://user3:password@localhost:27017/sampleone",
"PARSE_SERVER_CLIENT_KEY" : "ybUWZKQhv7Kb7nF2rk8efz"
}
flovilmart commentedon Apr 5, 2016
no, the JSON file uses the regular format with the same naming as the options when you use it as an express middleware
tanzeelrana commentedon Oct 15, 2016
my configuration.json is as follow
{
"appId": "appID",
"masterKey": "masterKey",
"databaseURI": "mongodb://localhost:27017/dev",
"port": 1338,
"serverURL": "http://localhost:1338/parse"
}
but I keep getting an error when I run
npm start configuration.js/configuration.js:2
"appId": "hello",
^
SyntaxError: Unexpected token :
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:20:19)
at parseConfigFile (/root/HIMS_Test_Server/lib/cli/utils/commander.js:88:22)
at Command._commander.Command.parse (/root/HIMS_Test_Server/lib/cli/utils/commander.js:128:18)
at exports.default (/root/HIMS_Test_Server/lib/cli/utils/runner.js:22:23)
Can someone help please