1
00:00:00,180 --> 00:00:06,090
In this video, we are going to create a three client Node.js module for connecting SW three.

2
00:00:06,270 --> 00:00:07,780
So let's get started.

3
00:00:07,800 --> 00:00:14,190
For that purpose, please open the we just do a code and as you remember that here you can see this

4
00:00:14,190 --> 00:00:15,870
is the our Node.js application.

5
00:00:15,900 --> 00:00:21,090
Now I'm going to create a separate Node.js module for the client object.

6
00:00:21,240 --> 00:00:27,810
So for all the interactions we need to connect S3 for that purpose, we should create or establish a

7
00:00:27,810 --> 00:00:29,080
static client object.

8
00:00:29,100 --> 00:00:33,840
So that means instead of we are creating a new client for every SDK request.

9
00:00:33,870 --> 00:00:39,420
It is best practice to create a separate Node.js module and use this module for every particular SDK

10
00:00:39,420 --> 00:00:40,050
command.

11
00:00:40,350 --> 00:00:46,350
For that purpose, I'm going to open the Section 21 and lecture for the crud.

12
00:00:46,350 --> 00:00:52,290
And you can remember that we have created Dynamo DB client object before and we will use these kind

13
00:00:52,290 --> 00:00:55,640
of commands and calls into our S3 client.

14
00:00:55,650 --> 00:01:03,120
So I'm copy this internal code and after that in the lecture folder, I'm going to create a new file

15
00:01:03,120 --> 00:01:11,710
which is the S3 client that JS and paste all this course into S3 client JS file.

16
00:01:11,730 --> 00:01:15,090
Now I can close and focus on the client JS file.

17
00:01:15,120 --> 00:01:21,020
If you save this file, you can see that first of all, I'm going to change these package name.

18
00:01:21,030 --> 00:01:27,450
The package name will be the client S3 and the import segment should be the S3 client object.

19
00:01:27,460 --> 00:01:30,680
And after that region can be leave as it is.

20
00:01:30,690 --> 00:01:40,560
And now in here I'm going to create an S3 client and export this S3 client with creating the S3 client

21
00:01:40,560 --> 00:01:41,190
object.

22
00:01:42,100 --> 00:01:46,320
Lock and pasting the region information lock.

23
00:01:46,630 --> 00:01:53,080
As you can see that we have created Node.js module for HDD connections with creating any instance of

24
00:01:53,080 --> 00:01:56,500
the HDD client object with passing information.

25
00:01:56,530 --> 00:02:00,670
This client object will use every interaction with our sdhc examples.

26
00:02:00,670 --> 00:02:07,510
So if you click Create and save these A's to the client JS file now we will use these objects in order

27
00:02:07,510 --> 00:02:13,150
to perform these use cases and pasting these commands into our SDK libraries.
