问题
After migrating an app from Parse.com to Heroku everything seems to work fine except for getting files. When i try to access a file from my app and from the dashboard/browser, i get an access denied message. I did add a parameter "FILE_KEY", with value copied from parse.com, to the config variables of my app but it did not help. I read about parsing the fileKey into the constructor of ParseServer, but do not know how. Do i have to add this to the index.js file or is there another way?
Thanks
回答1:
Solved :-) Add the line fileKey: process.... to index.js like so:
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'myAppId',
fileKey: process.env.FILE_KEY || 'myFileKey',
masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse', // Don't forget to change to https if needed
liveQuery: {
classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
}
});
来源:https://stackoverflow.com/questions/37622580/access-denied-to-files-after-migration-from-parse-com-to-heroku