MitocGroup / deep-framework

Full-stack JavaScript Framework for Cloud-Native Web Applications (perfect for Serverless use cases)
https://www.npmjs.com/package/deep-framework
Mozilla Public License 2.0
536 stars 68 forks source link

[deep-fs] readFile from s3 does not work #573

Closed ddimitrioglo closed 7 years ago

ddimitrioglo commented 7 years ago

I'm following the example from the documentation:

let system = fs.system;
system.readFile('some/file.txt', function() {
    // ...
});

and it woks in my local env as described, but does not work in my lambda after upload.

My use case:

const fs = this.kernel.get('fs').private;
fs.readFile(filePath, (err, result) => {
    return (err) ? reject(err) : resolve(result);
});
AlexanderC commented 7 years ago

Please provide more details like: real file path you want to read, microservice from where you're executing lambda and the microservice the desired file is located

ddimitrioglo commented 7 years ago
AlexanderC commented 7 years ago

File system abstraction (this.kernel.get('fs').private) uses private/${microapp-id} prefix, so a deep.dev.private.***x*xxx/pitch/2017/03/27/message.twig path should be like deep.dev.private.***x*xxx/private/${microapp-id}/pitch/2017/03/27/message.twig and the readFile call should look like fs.readFile('pitch/2017/03/27/message.twig', ...)