Я эмулировал пример конфигурации с feathers-blob . Вот мой код:
const hooks = require('./uploads.hooks');
const blobService = require('feathers-blob');
const AzureBlobStore = require('azure-blob-store').default;
const blobStorage = new AzureBlobStore({
accountName: process.env.AZURE_STORAGE_ACCOUNT,
container: process.env.AZURE_STORAGE_CONTAINER,
accessKey: process.env.AZURE_STORAGE_ACCESS_KEY,
});
module.exports = function (app) {
// Initialize our service with any options it requires
app.use('/api/uploads', blobService({ Model: blobStorage }));
// Get our initialized service so that we can register hooks
const service = app.service('api/uploads');
service.hooks(hooks);
};
И это код из ловушки, где служба называется
module.exports = function (options = {}) {
return async context => {
const { app } = context;
if (context.data.picture){
// upload the photo, requires a datauri
const uploaded = await app.service('api/uploads').create({
uri: context.data.picture
});
// get the id
const fileId = uploaded.id;
// add the id to the data
context.data.photo = fileId;
}
return context;
};
};
Но каждый раз, когда служба вызывается, я получаю следующую ошибку
/ node_modules / azure-blob-store / dist / appendStream.js: 76
delete res.getPropertiesFromHeaders;Ошибка типа: невозможно преобразовать неопределенное или нулевое значение в объект