Book Image

Building Scalable Apps with Redis and Node.js

By : Joshua Johanan
Book Image

Building Scalable Apps with Redis and Node.js

By: Joshua Johanan

Overview of this book

Table of Contents (17 chapters)
Building Scalable Apps with Redis and Node.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Inspecting requests


HTTP is request based. The browser makes a request and our web server responds with a response. This interaction is hidden from users in all browsers, for a good reason. When developing applications, we will have the need to view this interaction. For this we will use Chrome's Network tab.

This will be our first new application, so create a directory named requests. This directory will be the root of our project. The first thing we will do is use a basic Express server. This code is right from Express' API documentation. It is the most basic functioning 'hello world' we can build. Create an app.js file and add the following code to it:

var express = require('express');
var app = express();

app.get('/', function(req, res){
  res.send('hello world');
});

app.listen(3000); 

Next, open Chrome Developer Tools and the Network tab. Then, open http://localhost:3000. We should see something like the next screenshot:

This is a great summary of info that we care about as web developers...