覆盖Azure网址以访问Blob

时间:2018-09-21 16:53:17

标签: node.js multer

我已经使用Multer和MongoDB作为数据库NoSql开发了节点js REST服务。 该应用程序在Linux Server上运行良好。现在,我已在Azure上部署了该应用程序,在这种情况下,我需要使用Multer和Multer Azure。 这是Multer Azure代码:

var express = require('express')
var multer = require('multer')
var multerAzure = require('multer-azure')

var app = express()

var upload = multer({ 
storage: multerAzure({
connectionString: '[Azure Storage Connection String]', //Connection String for azure storage account, this one is prefered if you specified, fallback to account and key if not.
account: '[Azure Storage Account]', //The name of the Azure storage account
key: '[Azure Storage Account Key]', //A key listed under Access keys in the storage account pane
container: '[Blob Container Name]'  //Any container name, it will be created if it doesn't exist
blobPathResolver: function(req, file, callback){
  var blobPath = yourMagicLogic(req, file); //Calculate blobPath in your own way.
  callback(null, blobPath);
}
})
})

app.post('/', upload.any(), function (req, res, next) {
console.log(req.files)
res.status(200).send('Uploaded: ' + req.files)
})

Multer Azure文档具有以下信息:用于访问Blob的url Url 我如何设置此参数并将其显示为输出?这样我就可以获取图像了吗?

谢谢

最佳

0 个答案:

没有答案