Book Image

Learn Node.js by Building 6 Projects

By : Eduonix Learning Solutions
Book Image

Learn Node.js by Building 6 Projects

By: Eduonix Learning Solutions

Overview of this book

<p>With its event-driven architecture and efficient web services capabilities, more and more companies are building their entire infrastructure around Node.js. Node has become a de facto part of web development that any serious developer needs to master.</p> <p>This book includes six Node.js projects that gradually increase in complexity. You'll start by building a simple web server and create a basic website. You will then move to create the login system, blog system, chat system, and e-learning system.</p> <p>By creating and following the example projects in this book, you’ll improve your Node.js skills through practical working projects, and you'll learn how to use Node.js with many other useful technologies, such as ExpressJS, Kickstart, and Heroku.</p>
Table of Contents (12 chapters)

App and middleware setup


In this section, we'll create our application. We'll be using Express and we'll use something called the Express generator, which will allow us to just type in a command and have it generate a bunch of files and folders for us that we can use in our app.

Let's create a folder, you can create it wherever you want, and mine's going to be in my Projects folder. We'll call it nodeauth. Now inside the folder, I'll open my command line in that folder using Git Bash. So you want to make sure you have Express installed globally so you can access it from anywhere and also the Express generator. So we'll run the following command:

npm install -g express

Then we also want to run the following command:

install -g express-generator

Now while we're in the nodeauth folder, let's just use express. It will create a bunch of stuff for us. It gave us a bin folder, public, routes, views, app.js, and our package.json. What we'll do is open up the package.json file and I'll add this project...