The video for this lesson is currently being updated, please read the transcript instead.

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

To view the complete lesson you'll need to login or join this course.


Click to load comments...