Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
Signed-off-by: kfei <kfei@kfei.net>
  • Loading branch information
kfei committed Nov 27, 2016
1 parent e348188 commit 897528b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 4 deletions.
38 changes: 38 additions & 0 deletions README.md
@@ -0,0 +1,38 @@
# vue-s3-dropzone

> Vue 2.0 dropzone component uploads files to AWS S3 serverlessly.
## Overview

- A Vue.js 2.0 component wrapping [Dropzone.js](https://github.com/enyo/dropzone)
- Upload files to AWS S3 *serverlessly* with AWS Lambda.

## Demo

![demo-gif](https://i.giphy.com/3oriNVluNp8DmKgvFS.gif)

## Quickstart

Clone this repo:

```
git clone https://github.com/kfei/vue-s3-dropzone
```

This repo contains two directories: **frontend** and **lambda**. You must first
create the AWS Lambda function and deploy it onto AWS API Gateway. Then put the
invoke URL into `frontend/src/config.js` so that you can run and test the Vue
powered web client by:

```
cd frontend
yarn install
npm run dev
```

Please make sure you have correct priviledge/policy/CORS settings on AWS. Feel
free to open an issue if you happened to be trapped by that. :cry:

## License

MIT
19 changes: 15 additions & 4 deletions lambda/README.md
@@ -1,5 +1,16 @@
#### References
## Quickstart

- http://stackoverflow.com/q/21452756
- https://github.com/danialfarid/ng-file-upload/issues/743
- https://github.com/Sam-Martin/aws-image-upload-without-ec2
1. create a blank AWS Lambda function
2. choose Node 4.3 runtime
3. paste the code in `GetSignedURL.js` to the Lambda function code
4. add an env variable `AWS_BUCKET_NAME` with value equals to your S3 bucket
name
5. create an API on AWS API Gateway to trigger the Lambda function
6. deploy the API
7. done

## Hints
- the role of the Lambda function should have the correct permission on your
S3 bucket
- you should enable CORS and have a correct setting both in API Gateway and
S3 bucket

0 comments on commit 897528b

Please sign in to comment.