1
00:00:01,220 --> 00:00:05,660
Back over to the search function inside of our local API package, it's inside of your recruiting,

2
00:00:05,660 --> 00:00:09,290
our Express app, and as we just discussed, it has three primary purposes.

3
00:00:09,720 --> 00:00:14,000
So we're going to first work on making sure that we can somehow load up our react application inside

4
00:00:14,000 --> 00:00:14,480
the browser.

5
00:00:15,200 --> 00:00:18,980
Now, there's going to be just a little bit challenging because there's really two different scenarios

6
00:00:18,980 --> 00:00:23,600
we need to think about, or in other words, two different ways in which we are going to actually load

7
00:00:23,600 --> 00:00:28,970
up our react app or get that indexed HTML, file an index, not just file back over to the browser.

8
00:00:29,660 --> 00:00:34,970
So scenario number one that we need to think about is when we have actually deployed our daybook application

9
00:00:35,180 --> 00:00:38,780
and some user has installed it onto their local machine as a Seelie.

10
00:00:39,350 --> 00:00:44,240
So we can imagine that a user here might have done an NPM install for our book command line tool.

11
00:00:44,610 --> 00:00:46,430
They then run JDBC serve.

12
00:00:46,880 --> 00:00:51,740
So at that point in time, we need to start up our local API and we need to make sure that a user can

13
00:00:51,740 --> 00:00:54,680
somehow load up our built react files.

14
00:00:56,080 --> 00:01:00,320
The real question here is, where is that coming from, where are we getting these files from?

15
00:01:00,330 --> 00:01:03,510
How are we actually loading them up and sending them back over to the browser?

16
00:01:05,260 --> 00:01:09,130
Before we discuss what the solution here is going to be, one, talk about scenario two, that we need

17
00:01:09,130 --> 00:01:14,470
to think about, one scenario to scenario to let's make sure it actually says to this is when we are

18
00:01:14,470 --> 00:01:16,420
doing active development of our project.

19
00:01:16,430 --> 00:01:21,310
So like you and I are working on our project right now, at some point in time, we probably want to

20
00:01:21,340 --> 00:01:26,780
make changes to our REACT application and then see them update live on the fly inside of our browser.

21
00:01:27,100 --> 00:01:32,230
So in other words, we want to be running our create up, make some changes to our risk components and

22
00:01:32,230 --> 00:01:34,060
immediately see those changes appear.

23
00:01:35,710 --> 00:01:41,140
We still, however, want to be loading up our application through the local API because, remember,

24
00:01:41,140 --> 00:01:45,190
the local API is going to eventually give us that list of cells that we're going to be looking for and

25
00:01:45,190 --> 00:01:47,710
give us the ability to save a list of cells as well.

26
00:01:49,040 --> 00:01:53,090
So our browser in the development environment, like your browser, my browser, we're going to make

27
00:01:53,090 --> 00:02:00,290
a request to our local API and we need to somehow make a request over to our running react app application

28
00:02:00,620 --> 00:02:02,540
that is running our development server.

29
00:02:03,170 --> 00:02:08,810
And we need to somehow get those HTML and JavaScript files, get them back over into the browser.

30
00:02:09,660 --> 00:02:14,730
Normally, of course, whenever we are working on a reactor application, it would just look like this

31
00:02:15,210 --> 00:02:18,020
would just make a request directly from the browser to create racked up.

32
00:02:18,030 --> 00:02:23,260
And we do that all the time by running a great reactor up and going to say localhost or three thousand.

33
00:02:23,760 --> 00:02:27,810
Now, we're kind of saying that we want to have this extra piece in between and we need to make sure

34
00:02:27,810 --> 00:02:33,450
that our local API is going to somehow route requests over, get those development files and then send

35
00:02:33,450 --> 00:02:34,590
them back over to our browser.

36
00:02:35,540 --> 00:02:39,230
So these are the two scenarios we need to think about, we need to come up with a solution that is going

37
00:02:39,230 --> 00:02:40,640
to work in either scenario.

38
00:02:41,460 --> 00:02:42,490
So let's take a pause right here.

39
00:02:42,500 --> 00:02:46,340
Come back and we're going to first begin with addressing scenario number two.

