-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs for how to use S3 over GridStore? #307
Comments
You can set the FilesAdapter to use S3Adapter when you initialize the ParseServer like this 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',
masterKey: process.env.MASTER_KEY || 'myMasterKey',
clientKey: process.env.CLIENT_KEY || 'myClientKey',
restAPIKEY: process.env.RESTAPI_KEY || 'myRestKey',
fileKey: process.env.FILE_KEY || 'myFileKey',
filesAdapter: new S3Adapter(
process.env.AWS_ACCESS_KEY,
process.env.AWS_SECRET_ACCESS_KEY,
{bucket: process.env.AWS_BUCKET_NAME, bucketPrefix: "", directAccess: true}
),
pushAdapter: new SNSAdapter(
process.env.AWS_ACCESS_KEY,
process.env.AWS_SECRET_ACCESS_KEY,
{region: "us-east-1"}
)
}); |
@oclef thanks, have you tested it and do pffile saves go to s3 and a reference url goes in the database? |
Yes, I've tested. files goes to s3 and reference goes to mongo |
@oclef thanks, I feel a bit stoopid right now maybe its due to me coding all way and switching between js, php and python but where do I put my aws keys in.. ? Also I just saw this when trying to deploy the latest parse example..
|
@gateway You need to import the S3Adapter. var S3Adapter = require('parse-server').S3Adapter;
var ParseServer = require('parse-server').ParseServer;
...
filesAdapter: new S3Adapter({
/** options **/
});
... |
An adapter I wrote to use AWS SNS as the push server. I've since setup my https://github.com/oclef/parseServer Cheers, On Thu, Feb 18, 2016 at 3:45 AM, Michael Bina notifications@github.com
Predestination was doomed from the start. |
@oclef Looks useful. Did you consider making a pull request? I haven't tried to incorporate ParsePushAdapter which I just looked into, but this looks easier. |
Actually, this is what you will want to use https://github.com/oclef/parse-server/tree/f2c6cc829927e084fb0a695c30ab701f1c923860 On Thu, Feb 18, 2016 at 3:45 AM, Michael Bina notifications@github.com
Predestination was doomed from the start. |
Looks like it was forked a bit behind 2.0.8 so it's gonna take some merging. |
It worked, but it doesn't really conform with the architecture. TBH, it's better to just setup your own push server using the latest release. |
S3 docs now available here: https://github.com/ParsePlatform/parse-server/wiki/Storing-Files-in-AWS-S3 |
I see in the depo s3 adaptor but no real docs on how to set this up to work. I know their is a FilesAdapter.js, do I just change these lines.
to
Then looking at the S3Adaptor code I see various keys that need to be set?
Could we just get a small writeup on this? Also will their be an option on data migration to move files to a s3 bucket instead?
The text was updated successfully, but these errors were encountered: