1
00:00:01,630 --> 00:00:06,030
Let's have a very quick side discussion and discuss what this directory argument is all about.

2
00:00:06,580 --> 00:00:10,660
So I just introduced that directory argument in the last video without really explaining what was going

3
00:00:10,660 --> 00:00:11,170
on with it.

4
00:00:11,500 --> 00:00:15,490
Let me first go over to my terminal very quickly, and I just want to point out something to you very

5
00:00:15,490 --> 00:00:16,790
fast, OK?

6
00:00:16,870 --> 00:00:21,490
So, again, our expectation is that at some point in time, a user might run a command like daybook

7
00:00:21,490 --> 00:00:24,610
Cerf notes, or something like that.

8
00:00:25,500 --> 00:00:31,980
But a user might expect that they could put in not only a file name right here, but potentially also

9
00:00:31,980 --> 00:00:34,590
a path to where this file actually exists.

10
00:00:35,040 --> 00:00:41,280
So, for example, they might say open up inside of my notes folder.

11
00:00:41,310 --> 00:00:46,950
The notes file a user very potentially, without doubt, they might try to write out something like

12
00:00:46,950 --> 00:00:47,280
this.

13
00:00:47,550 --> 00:00:50,280
And I just want to make sure that our Seelie can handle this kind of thing.

14
00:00:50,670 --> 00:00:54,660
I want to make sure that we do not try to create a file called Notes Slash Notes.

15
00:00:55,530 --> 00:01:01,350
Instead, I want to make sure that our client understands that the intent here is to go into the notes

16
00:01:01,350 --> 00:01:04,890
directory, then create a notes, not just file inside there.

17
00:01:05,489 --> 00:01:07,910
So that's what this directory argument is all about.

18
00:01:08,460 --> 00:01:10,050
Just to make sure this is crystal clear.

19
00:01:10,110 --> 00:01:12,540
Let's take a look at a diagram to just really spell things out.

20
00:01:14,630 --> 00:01:19,610
OK, so in this diagram, I've got an example folder structure on the left hand side, we're going to

21
00:01:19,610 --> 00:01:23,360
imagine that on a user's machine there is a workspace directory.

22
00:01:23,660 --> 00:01:29,270
Inside, there is a notes directory, and inside of notes are three different folders, go notes, typescript

23
00:01:29,270 --> 00:01:30,590
notes and JavaScript notes.

24
00:01:31,220 --> 00:01:34,700
And then finally, inside the J.S. Notes directory is notebook James.

25
00:01:35,830 --> 00:01:40,990
Remember that whenever you open up your terminal, your terminal is always open to some current directory

26
00:01:40,990 --> 00:01:41,800
on your machine.

27
00:01:42,260 --> 00:01:47,020
So let's imagine for a second that a user is inside of their notes directory inside their terminal.

28
00:01:47,020 --> 00:01:49,940
So their terminal is currently pretty much right there at that folder.

29
00:01:50,620 --> 00:01:57,310
We want to allow a user to write out books or go into the James Notes directory and open up the notebook

30
00:01:57,880 --> 00:01:58,350
file.

31
00:01:58,900 --> 00:02:01,220
And so a command like that might look like this right here.

32
00:02:01,240 --> 00:02:04,250
So go into Jass notes, notebooks.

33
00:02:05,870 --> 00:02:12,360
So in this kind of scenario, we would want to provide a file name our server of Simply Notebook's,

34
00:02:12,380 --> 00:02:16,890
that is the name of the exact file that a user wants to save their cells into.

35
00:02:17,690 --> 00:02:21,460
We then want to also pass along that directory argument as well.

36
00:02:21,470 --> 00:02:26,050
In this case, the directory should be the entire absolute path to that folder.

37
00:02:26,570 --> 00:02:30,020
So everything from workspace notes, just notes.

38
00:02:31,110 --> 00:02:31,870
That's our intent.

39
00:02:31,890 --> 00:02:36,850
That's the goal and this is going to allow a user to write in any kind of relative path when they run

40
00:02:36,890 --> 00:02:39,870
JDBC serve or technically any kind of absolute path as well.

41
00:02:40,070 --> 00:02:43,440
It's going to make sure that we always open up the correct file in the correct directory.

42
00:02:44,660 --> 00:02:48,380
Now that we understand what the directory argument is all about, we're going to do just a little bit

43
00:02:48,380 --> 00:02:53,390
more work in the next video inside of our action function in our Seelie, make sure that we properly

44
00:02:53,390 --> 00:02:58,100
calculate what this directory string is and pass it along into the serve function.

