angular-evaporate

AngularJS module for the EvaporateJS library, with complete example

Angular Core Dependency: ^1.5.8

Module License: MIT

Added by: Sam Deering

GitHub

Repository

uqee/angular-evaporate

Stats

Stars: 26

Watchers: 26

Forks: 13

Author

Uqee
Uqee

Module Description

angular-evaporate

This code is intended to make an awesome EvaporateJS library work as AngularJS module. Inspired by sourcec0de's example, which is currently using jQuery.

Get started

Include evaporate.js and all files from the current project's ./lib folder into your project

Add global config variable, it will be passed directly into the EvaporateJS itself (which is also exposed as global variable Evaporate after including evaporate.js):

evaporateOptions = {
  signerUrl: '<path to your server\'s route, which will sign requests with your private aws_secret_key>',
  aws_key:   '<your public aws_access_key>',
  bucket:    '<your s3 bucket name>',
  logging:   false|true // logs to console
  // ... other parameters if accepted by EvaporateJS
};

Add file input to your html file (in this case evaData variable will contain all evaporate data for this particular input):

<input type="file" multiple="multiple" evaporate eva-model="evaData">

Add angular dependency to your js project:

angular.module('<your app name>', ['evaporate'])

For more information, please, read comments in example files ./example/index.html and ./example/index.js

Run the example

  1. Clone the repo: git clone https://github.com/uqee/angular-evaporate.git
  2. Navigate into the project folder: cd ./angular-evaporate
  3. Install frontend deps: bower install
  4. Navigate into the example folder: cd ./example
  5. Install backend deps: npm install
  6. Update credentials:
  7. Set up your AWS S3 bucket: follow instructions at EvaporateJS
  8. Update evaporateOptions in ./index.html according to your own info from the previous step
  9. Run the server:
  10. If you have foreman installed then: * Set environment: create an .env file with this data: PORT=<tcp port number> AWS_SECRET_KEY=<your private aws_secret_key> * Run: npm start
  11. If you do not then: * Set environment: manually, e.g. export PORT=<...>; export AWS_SECRET_KEY=<...>; * Run: node server.js
  12. In browser navigate to: localhost:<PORT>/example

P.S.

Always use server-side validation for incoming requests to evaporateOptions.signerUrl, because in this simple example anyone could send you anything he wanted and just get it signed with your secret key.

Module stats last updated: 2017-09-29 15:00:07

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!