Refactoring using schema
In this video, we'll move our new models to a better location in our code.
Firstly, let's create a new directory
models, then we'll create files for our two model types.
$ mkdir server/models $ touch server/models/item.js server/models/user.js
Creating item model
Now we'll move the model code from the main script into those files so that our code is better organized.
Let's start with item.js. I'll cut this from the index and paste it into this new file.
Click to load comments...