Menu
AWS SDK for JavaScript
Developer Guide

Getting Started in Node.js

This getting started exercise guides you through integrating an AWS-backed Node.js web application with a dependency on the SDK for JavaScript. The project creates an Amazon Simple Storage Service (Amazon S3) service object and then uses that object to interact with Amazon S3 by creating a bucket and uploading a file.

For information about downloading and installing the AWS SDK for JavaScript, see Installing the SDK for JavaScript.

Step 1: Downloading the Sample Project

You can download the sample project from GitHub with the following command. You must have Git installed.

Copy
git clone https://github.com/awslabs/aws-nodejs-sample.git

Step 2: Installing the SDK and Dependencies

From the aws-nodejs-sample directory, type the following.

Copy
npm install

Step 3: Configuring the Access Keys

Create your credentials file at ~/.aws/credentials (C:\Users\USER_NAME\.aws\credentials for Windows users) and then add the following lines. Replace YOUR_ACCESS_KEY_ID and YOUR_SECRET_ACCESS_KEY with the actual values from your account.

Copy
[default] aws_access_key_id = YOUR_ACCESS_KEY_ID aws_secret_access_key = YOUR_SECRET_ACCESS_KEY

Step 4: Running the Sample

Type the following command to run the sample.

Copy
node sample.js