express-azure-image-upload
v1.0.6
Published
A drop-in route handler that places an image in an Azure Storage Container and returns its blob URL
Downloads
10
Maintainers
Readme
Usage
When creating an instance of ImageUpload
you will need to provide three parameters:
storageAcct
- The name of the Azure storage account being used for images.storageKey
- The access key associated withstorageAcct
.storageContainer
- The name of a storage container that exists understorageAcct
.
In your Express router:
var express = require( "express" );
var ImageUpload = require( "express-azure-image-upload" );
var router = express.Router();
function imageHandler () {
var storageAcct = "yourStorageAcct";
var storageKey = "yourStorageKey";
var storageContainer = "yourStorageContainer";
var imageUpload = new ImageUpload( storageAcct, storageKey, storageContainer );
return imageUpload.handler;
}
router.post( "/whatever", imageHandler() );
When making a POST request:
Include the image in a form data property named image
.