access json file in public folder react code example
Example 1: create react app in current folder
create-react-app .
Example 2: move file from one folder to another in aws s3 nodejs
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: 'xxx',
secretAccessKey: 'xxx'
});
var s3 = new AWS.S3();
var params = {
Bucket : 'bucketname',
CopySource : 'bucketname/externall/1.txt',
Key : "1.txt",
ACL : 'public-read',
};
s3.copyObject(params, function(err, data) {
if (err)
console.log(err, err);
else {
console.log(data);
}
});