- [Instructor] So before we start adding endpoints
to our server, let's set up our folder structure
for our project.
I personally put everything in a source folder
and then start branching out the folders
and files I'll use for the server,
like controllers, models and routes.
So let's get to it.
Also, I'd like to mention
that I'm going to leave my server running
and that's why I'm using nodemon,
because whenever I make changes in my server
or in the code anywhere in the folder
that the server is running,
then it's going to restart it automatically for me.
So if there's any errors or anything that I've done
while I'm coding, I'm going to see it right here,
that the server's not running.
So let's go ahead and create the folder source
inside of the main directory.
So what you want to do is click on new folder
N-S-R-C as the source folder.
And then inside of that folder,
I'm going to create three more folders.
So one will be controllers
and then you want to click back on source, create a new one,
this one's going to be models for our database.
And then a third one which will be the routes.
And inside of each of these folders,
I'm going to create the proper files.
So inside of route, I'm going to create
a new file called crmRoutes
and it's going to be a .js file.
And as you can see, the server has restarted automatically
because I just added a new file.
There's no code in that file
but still the server runs it again because there's something
that just popped up inside of that folder.
So now I'm going to create
a new file inside of my models folder,
which I'll call crmModel.
And then finally, inside of my controllers,
I'm going to create a brand new file
called crmController.js
and that's it.
So this is fairly straightforward
and we'll start adding items to these files
as we add our routes, models and controllers.
So let's move on.