341
Chapter 8 Websites and services
CHAPTER 8 Websites and services
T
he previous chapters have presented many things you can do at the browser, but you
can also do things at the server. When using Microsoft technologies, it’s typical to create
a website by using Visual Studio .NET, which uses ASP.NET or model, view, controller (MVC)
technologies that are programmed using Visual Basic .NET or C#. These technologies and
languages are outside the scope of this book, but can you learn to create a form without
creating a website to process the form?
This book is about HTML5, CSS3, and JavaScript; this chapter covers web services, using
JavaScript on the web server, which is possible by using Node.js, a platform built on the
Google Chrome JavaScript runtime.
Lessons in this chapter:
■■Lesson 1: Getting started with Node.js 341
■■Lesson 2: Working with web services 364
Before you begin
To complete this book, you must have some understanding of web development. This
chapter requires the hardware and software listed in the “System requirements” section in
the book’s Introduction.
Lesson 1: Getting started with Node.js
The Node.js platform is built on the Google Chrome JavaScript runtime for easily building
fast, scalable network applications. The platform implements an event-driven, non-blocking
I/O model and is lightweight and efficient. This platform is perfect for data-intensive, real-
time applications that run across distributed devices.
Using Node.js, you can write JavaScript that executes on the back-end server. Node.js
interprets and executes your JavaScript by using Google’s V8 virtual machine, which is the
same runtime environment for JavaScript that Google Chrome uses.