Access denied to files after migration from parse.com to heroku

扶醉桌前 提交于 2019-12-12 03:43:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!