Creating a new web app project

Before you can add sockets to your web application, you need a web application to add them to, which is exactly what we'll create in this section. We'll make a basic Express app, which we'll get up on GitHub. Then, we'll deploy it to Heroku so we can view it live in the browser.

Now, the first step to that process is going to be to making a directory. We'll do a few things together to get us all going in the right direction. The first step in the process from the desktop is to run mkdir to make a new directory for this project; I'm going to call it node-chat-app.

Then, we can use cd to navigate into that directory and we can run a few commands:

mkdir node-chat-appcd node-chat-app

First up, npm init. As with ...

Get Advanced Node.js 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.