javascript 22

Tip: Connecting to localstack S3 using the JavaScript AWS SDK v3

I had some issues getting the v3 AWS SDK for JavaScript to communicate with localstack S3, but I found a solution! With the V2 JS SDK, the configuration object for the S3 client looks like: { "region": "eu-west-1", "endpoint": "http://localhost:4566", "s3ForcePathStyle": true } The last field tells the sdk not to use .hostname style connections, and instead puts the bucket in the path. For local..

[JavaScript] Scheduling: setTimeout and setInterval

Javascript Scheduling: setTimeout and setInterval A block of JavaScript code is generally executed synchronously. But there are some JavaScript native functions (timers) which allow us to delay the execution of arbitrary instructions. setTimeout() setInterval() These let you run a piece of JavaScript code at some point in the future. That’s called “scheduling a call”. In this tutorial I’ll expla..