Methods to extend an application

One thing you can do to extend an application if you are building a larger site is to build it using MVC (Model, View, Controller). We already have the view part sorted, so let's look at the other pieces. We have some sort of a controller setup with our routes directory. The next step will be to create a file for each. For example, we can have account.js, which will have the login, logout, and createAccount functions. We haven't really covered adding models to our app. We can create a directory called models, and then add a user model, for which we can find a user, update, and create a user to tie in with our account controller. Note that there are some other frameworks that build on Express in this way (sails.js ...

Get Building Scalable Apps with Redis and Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.