1
00:00:00,240 --> 00:00:05,760
All right, and before we express server and start setting up our controllers and all that cool stuff,

2
00:00:06,450 --> 00:00:09,600
I want to talk about the imports and exports in note.

3
00:00:10,540 --> 00:00:18,070
So for a long, long, long, long, long time node was using actually it is still using common areas

4
00:00:18,610 --> 00:00:20,680
where essentially we use this require.

5
00:00:21,010 --> 00:00:23,500
But there's also support right now for your six modules.

6
00:00:23,890 --> 00:00:31,180
Something about what worry I've been doing for the last hour, essentially in our rundown import from.

7
00:00:31,390 --> 00:00:34,390
And then the package component and you get the gist.

8
00:00:34,900 --> 00:00:39,820
And technically, when you're just building an API, it kind of comes down to preference whether you

9
00:00:39,820 --> 00:00:43,840
want to use common gas or you want to use six in node.

10
00:00:44,230 --> 00:00:49,120
But in my opinion, when you're working on a project where you already have the front end application

11
00:00:49,390 --> 00:00:56,230
using this import and export basically S6 and then you have the server where you need to switch over

12
00:00:56,230 --> 00:00:57,220
to your common address.

13
00:00:57,730 --> 00:01:00,580
This leads to some silly bugs over the time.

14
00:01:00,940 --> 00:01:07,360
So it's definitely my preference to set up both the server and the frontend with the S6.

15
00:01:07,360 --> 00:01:14,020
Now front end is right away from the get go with Create React app, but on a server, we actually need

16
00:01:14,020 --> 00:01:15,070
to do that manually.

17
00:01:15,490 --> 00:01:24,100
And according to their darks, we have two options we can either use the file extension a.j.'s or in

18
00:01:24,100 --> 00:01:25,090
the package JSON.

19
00:01:25,390 --> 00:01:28,450
We can set up type and module.

20
00:01:28,960 --> 00:01:30,070
And let me showcase that.

21
00:01:30,070 --> 00:01:37,960
So again, if you navigate to their docs domain, so file's ending with images or files and then jazz.

22
00:01:38,260 --> 00:01:43,810
If in a package JSON top level we have type module and this is what I'm going to do.

23
00:01:44,230 --> 00:01:51,700
So I'm going to navigate your package, JSON and then somewhere here, let's say after the main one,

24
00:01:52,090 --> 00:01:56,050
let's go with type and let's set it up as module.

25
00:01:56,590 --> 00:02:03,190
And once we do that from now on will be able to use, import and export.

26
00:02:04,190 --> 00:02:05,960
In our server as well.

27
00:02:06,320 --> 00:02:13,080
So not only on the front end, but also we can do that in a server, and we'll do that starting with

28
00:02:13,080 --> 00:02:16,220
the next video wherein we'll set up our Express one.

29
00:02:16,490 --> 00:02:21,030
Now, if you don't want to, you don't have to do this part.

30
00:02:21,050 --> 00:02:21,600
Pardon my cash.

31
00:02:21,620 --> 00:02:26,420
I'll definitely push for this one because like I said, when you're developing mine project, it leads

32
00:02:26,420 --> 00:02:33,170
to somewhat confusion when you have front and running one import set up and then the server running

33
00:02:33,170 --> 00:02:33,920
a different one.

34
00:02:34,250 --> 00:02:38,540
And with this in place now, we can start setting up our basic express server.

