vanessafarraye / postit

first project
0 stars 2 forks source link

heroku #1

Open vanessafarraye opened 9 years ago

vanessafarraye commented 9 years ago

My project doesn't work completely on heroku, since heroku doesn't let you upload pictures and my app is all about uploading pictures it doesn't work perfectly. If I upload a picture it uploads it but when I logout and log in again the picture is not there anymore.

I found a page that can be helpful https://devcenter.heroku.com/articles/read-only-filesystem

ratacat commented 9 years ago

okay, I think first off you will need an AWS account from amazon. http://aws.amazon.com/ Inside AWS, we will want to create an S3 bucket, and Identity and Access Management credentials.

Once those are ready, you will want to probably use the node-s3 package. https://www.npmjs.com/package/node-s3

And finally you will need to rewrite some bits of your code, replacing it with pieces that use S3. I think primarily in app.use-> multer and app.use->uploads. (wherever photos get 'saved' and 'accessed')

Also, since we want to keep security credentials out of public github, you will probably need to save your S3 credentials in ENV variables.