Skip to content

Conversation

@Damola12345
Copy link
Contributor

@NetanelBasal resolved #2 just added s3 to the env on docker-compose file
Screenshot 2022-07-18 at 22 54 49

@Damola12345
Copy link
Contributor Author

@NetanelBasal pls kindly review

@NetanelBasal
Copy link
Member

It does not work without it? I think the default is all services

@Damola12345
Copy link
Contributor Author

Yes you're right the default is all service,
Are you saying i should map a different port for S3
Screenshot 2022-07-19 at 21 47 38

@NetanelBasal
Copy link
Member

No. I would like to have a live example in the code. For example:

https://www.zeolearn.com/magazine/uploading-files-to-aws-s3-using-nodejs

@Damola12345
Copy link
Contributor Author

Okay will do my best
Thanks

@Damola12345
Copy link
Contributor Author

@NetanelBasal pls kindly check it out and review

@Damola12345
Copy link
Contributor Author

Screenshot 2022-07-23 at 17 45 21

Screenshot 2022-07-23 at 17 45 44

Comment on lines +7 to +16
const BUCKET_NAME = "nxboy";

const s3 = new AWS.S3({
region: "us-east-1",
accessKeyId: KEY_ID,
secretAccessKey: SECRET_KEY,
endpoint: 'http://localhost:4566', // This is the localstack EDGE_PORT
s3ForcePathStyle: true,
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very specific s3 bucket? what's the intention here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harellevy just an example to create a localstack s3 bucket

Comment on lines 30 to 50
// const uploadFile = (filename) => {
// const filecontent = fs.readFileSync(filename);

// const params = {
// Bucket: BUCKET_NAME,
// Key: "",
// Body: filecontent,
// ContentType: ""
// }

// s3.upload(params,(err, data)=>{
// if(err){
// console.log(err)
// }
// else{
// console.log("File uploaded successfully", data.Location)
// }
// })
// }

// uploadFile("") No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay i will
Thanks

@Damola12345
Copy link
Contributor Author

@NetanelBasal pls kindly review and revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add S3 example

3 participants