summaryrefslogtreecommitdiff
path: root/app/node_modules/okservices/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/node_modules/okservices/index.js')
-rw-r--r--app/node_modules/okservices/index.js10
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;