Using MVC directory structure
Like any application, how we organize our API code is important for ease of use.
We're going to use the MVC architecture for the server app i.e. "model, view, controller". You'll see as we progress that this is a logical and simple approach.
Controller
Let's begin by setting up the first controller. We'll create a new folder called controllers
, and create a file items.js
which will hold the logic for any route that loads items.
$ mkdir server/controllers
Click to load comments...