Chapter 6. The Server

At this point, we’ve seen the major technologies associated with the client-side part of a web application. We’ve also learned a bit about how the browser communicates with a server using JSON and AJAX. Next, we’re going to delve into server-side programming.

Understanding the server-side part of the application will require us to learn more about the client-server model, the HTTP protocol, and Node.js. Node.js is a relatively new (and exciting) technology that allows us to easily build event-driven servers using JavaScript.

Setting Up Your Environment

Setting up a development environment that supports building database-driven applications can be a daunting task, and describing the procedure for Windows, Mac OS, and Linux is way beyond the scope of this book. To simplify the process, I’ve created a set of scripts that will get you up and running relatively quickly using Vagrant and VirtualBox.

Vagrant is a tool that helps build a development environment using a virtual machine. You can think of a virtual machine as a separate computer running completely within the confines of your computer. We’ll elaborate more on this in Mental Models. For now, just understand that we’ll be using Vagrant along with VirtualBox to build a virtual server-side development environment. This environment will include the majority of the tools that we’ll use throughout the rest of this book.

Obviously, part of this process is about convenience: even though installing a Node.js development ...

Get Learning Web App Development 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.