URL-адрес Multer Azure для доступа к BLOB-объектам - PullRequest
0 голосов
/ 21 сентября 2018

Я разработал REST-сервис узла js, используя Multer и MongoDB в качестве базы данных NoSql.Приложение очень хорошо работает на 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 содержит следующую информацию: URL-адрес URL для доступа к BLOB-объекту Как я могу установить этот параметр и показать его в выводе?Так что я могу получить изображение с помощью get?

Спасибо

Лучший

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...