Skip to content
This repository has been archived by the owner on Nov 30, 2017. It is now read-only.

NodeJS application that consumes Dingo S3 credentials for Amazon S3 API

Notifications You must be signed in to change notification settings

dingotiles/node-s3-upload-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example nodejs application

This application consumes s3 credentials supplied via the dingo-s3 service broker.

Run the app

cf create-service dingo-s3 essential node-s3-example-s3
cf push --no-start
cf bind-service node-s3-example node-s3-example-s3
cf start node-s3-example

Accessing credentials

Use cf-env to access the credentials via the method require('cfenv').getAppEnv().getServiceCreds(/s3/). The method getServiceCreds(spec) must receive either the exact name or a regular expression matching the name of the service instance.

The returned structure looks like this:

{
  "username": "IAM_USER_NAME",
  "access_key_id": "AWS_ACCESS_KEY",
  "secret_access_key": "AWS_SECRET",
  "bucket": "BUCKET_NAME"
}

About

NodeJS application that consumes Dingo S3 credentials for Amazon S3 API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published