Let's have a very quick side discussion and discuss what this directory argument is all about.
So I just introduced that directory argument in the last video without really explaining what was going
on with it.
Let me first go over to my terminal very quickly, and I just want to point out something to you very
fast, OK?
So, again, our expectation is that at some point in time, a user might run a command like daybook
Cerf notes, or something like that.
But a user might expect that they could put in not only a file name right here, but potentially also
a path to where this file actually exists.
So, for example, they might say open up inside of my notes folder.
The notes file a user very potentially, without doubt, they might try to write out something like
this.
And I just want to make sure that our Seelie can handle this kind of thing.
I want to make sure that we do not try to create a file called Notes Slash Notes.
Instead, I want to make sure that our client understands that the intent here is to go into the notes
directory, then create a notes, not just file inside there.
So that's what this directory argument is all about.
Just to make sure this is crystal clear.
Let's take a look at a diagram to just really spell things out.
OK, so in this diagram, I've got an example folder structure on the left hand side, we're going to
imagine that on a user's machine there is a workspace directory.
Inside, there is a notes directory, and inside of notes are three different folders, go notes, typescript
notes and JavaScript notes.
And then finally, inside the J.S. Notes directory is notebook James.
Remember that whenever you open up your terminal, your terminal is always open to some current directory
on your machine.
So let's imagine for a second that a user is inside of their notes directory inside their terminal.
So their terminal is currently pretty much right there at that folder.
We want to allow a user to write out books or go into the James Notes directory and open up the notebook
file.
And so a command like that might look like this right here.
So go into Jass notes, notebooks.
So in this kind of scenario, we would want to provide a file name our server of Simply Notebook's,
that is the name of the exact file that a user wants to save their cells into.
We then want to also pass along that directory argument as well.
In this case, the directory should be the entire absolute path to that folder.
So everything from workspace notes, just notes.
That's our intent.
That's the goal and this is going to allow a user to write in any kind of relative path when they run
JDBC serve or technically any kind of absolute path as well.
It's going to make sure that we always open up the correct file in the correct directory.
Now that we understand what the directory argument is all about, we're going to do just a little bit
more work in the next video inside of our action function in our Seelie, make sure that we properly
calculate what this directory string is and pass it along into the serve function.