从parse.com迁移到heroku后,文件访问被拒绝 [英] Access denied to files after migration from parse.com to heroku
问题描述
将应用程序从Parse.com迁移到Heroku之后,除了获取文件之外,其他所有功能似乎都可以正常工作. 当我尝试从我的应用程序和仪表板/浏览器访问文件时,收到访问被拒绝的消息.我的确在我的应用程序的配置变量中添加了一个参数"FILE_KEY",其值从parse.com复制而来,但没有帮助. 我读过有关将fileKey解析到ParseServer的构造函数中的知识,但不知道如何.我是否必须将此添加到index.js文件中?还是有另一种方法?
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?
谢谢
推荐答案
已解决:-) 像这样将行fileKey:process ....添加到index.js:
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
}
});
这篇关于从parse.com迁移到heroku后,文件访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!