diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-08 23:19:49 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-08 23:19:49 -0400 |
| commit | 2a4266fd00a0b1327a7b24ee9807b94f0060a118 (patch) | |
| tree | 316b74a259ecd3ba5bafbe89f9cbfdf30b8d4159 /app/node_modules/okservices | |
| parent | bae6a32b83209846b2a6a757c0c414d537c157b2 (diff) | |
load environment with dotenv
Diffstat (limited to 'app/node_modules/okservices')
| -rw-r--r-- | app/node_modules/okservices/index.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/node_modules/okservices/index.js b/app/node_modules/okservices/index.js index cb96072..10de460 100644 --- a/app/node_modules/okservices/index.js +++ b/app/node_modules/okservices/index.js @@ -5,6 +5,8 @@ function OKImageService(options) { options = options || {}; if (!options.express) throw new Error('Express not provided to OKImageService'); + if (!options.s3) + throw new Error('S3 configuration not provided to OKImageService'); var express = options.express; var router = express.Router(); @@ -14,6 +16,14 @@ function OKImageService(options) { router.post('/', function(req, res) { // req should have a method `file` on it which is // provided by skipper. Use that to do AWS stuff + req.file('image').upload({ + adapter: require('skipper-s3'), + key: options.s3.key, + secret: options.s3.secret, + bucket: options.s3.bucket + }, function (err, uploadedFiles) { + // + }); }); this._middleware = router; |
