summaryrefslogtreecommitdiff
path: root/app/node_modules/okservices/index.js
blob: cb96072e21a1985681eed051cdf509e7794cc684 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var skipper = require('skipper');

function OKImageService(options) {
  if (!(this instanceof OKImageService)) return new OKImageService(options);
  options = options || {};
  if (!options.express)
    throw new Error('Express not provided to OKImageService');
  var express = options.express;

  var router = express.Router();

  router.use(skipper());

  router.post('/', function(req, res) {
    // req should have a method `file` on it which is
    // provided by skipper. Use that to do AWS stuff
  });

  this._middleware = router;
}

OKImageService.prototype.middleware = function() {
  return this._middleware;
};

module.exports = {
  OKImageService: OKImageService
};