We're using node fs to access Files from NFS Network Drive. While testing locally, it works fine as it tries to access the NFS using my credentials in the background.
When I deploy the same code in cloud, it fails as my credentials are not present.The point is, to access the shared directory, I need to authenticate in the fs part.
So, I am looking for a way to solve this problem by giving credentials upon accessing or any other ways. Somehow I need to supply username/password/domain because this file requires special permission. Is it possible to supply permissions somehow? For example:
var fs = require('fs');
var file = '\\someserver\stuff\names.txt';
var credentials = { username:'mydomain/jsmith', password:'password' }; ???
fs.readFile(file, 'utf8', function(err, data) {
if (err) throw err;
console.log(data);
});
Note: Any solutions apart from mounting pls.