uploader.js 534 B

1234567891011121314151617181920212223242526272829
  1. var AWS = require("aws-sdk")
  2. function connectAws(bucket, region, identity) {
  3. AWS.config.update({
  4. region: region,
  5. credentials: new AWS.CognitoIdentityCredentials({
  6. IdentityPoolId: identity
  7. })
  8. });
  9. var s3 = new AWS.S3({
  10. apiVersion: '2006-03-01',
  11. params: {
  12. Bucket: bucket
  13. }
  14. });
  15. return s3;
  16. }
  17. module.exports = function() {
  18. var s3 = connectAws("a.tum.dk", "eu-west-1", "eu-west-1:5343270a-03fd-4856-ad07-25f1e2c78246");
  19. return s3;
  20. }