Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
All but the simplest of sites will eventually need to send data to and receive data from the server. It’s great that our server is delivering static files—we’ll need that for our CSS, images, and other resources—but at some point we’ll probably want to be able to serve a single-page application where static requests don’t play as large a role. The great thing about Node is that, as JavaScript developers, we can have complete control over our API on both the client and server, and even reuse some of our code on both sides. But let’s start with setting up handling for simple GET and POST requests.