Sample project that implements image upload and resizing using node.js, blitline.com and AWS s3 on Heroku via ephemeral file storage.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
views Fix changes. Mar 5, 2014
.gitignore
Procfile
README.md Added links using correct markdown Oct 22, 2012
package.json Add an error catch to the listPageOfKeys call Oct 22, 2012
web.js Fix changes. Mar 5, 2014

README.md

This is a demo application that shows how to manage file uploads and AWS using Node.js on Heroku. This sample app makes use of the Heroku 'ephemeral file system'.

Reference

Requirements

  • AWS Account and defined bucket.
  • Heroku Account
  • Node installed locally.

Setup

To test this application you need to define the following variables in either your local node workspace (.bash_profile) or as heroku configuration variables. I usually create a .settings file in my local workspace and add .setting to my repos .gitignore.

For local development (.settings or ~/.bash_profile)

export AWS_ACCESS_KEY_ID=XXXXX
export AWS_ACCESS_ACCESS_KEY=XXXX
export AWS_S3_BUCKET=XXXXXXXX
export BLITLINE_API_KEY=XXXXX

For Heroku Config SDK

heroku config:add AWS_ACCESS_KEY_ID=XXXXX
heroku config:add AWS_ACCESS_ACCESS_KEY=XXXX
heroku config:add AWS_S3_BUCKET=XXXXXXXX
heroku config:add BLITLINE_API_KEY=XXXXX

Blitline.com Setup

The blitline image resize API is an optional element in this demo. If you do not want to setup an account, then leave the BLITLINE_API_KEY variable defined. The code code will only call the resizing code when it is defined.

Remember to allow Blitline to save resized images back to your AWS bucket, you need to define the access rules in your AWS console to give them specific write access. Get the API specific settings from https://blitline.com/docs/s3_permissions