Free Sample
+ Collection

Node Web Development - Second Edition

David Herron

JavaScript is no longer just for browsers and this exciting introduction to Node.js will show you how to build data-intensive applications that run in real time. Benefit from an easy, step-by-step approach that really works.
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781782163305
Paperback248 pages

About This Book

  • Learn about server-side JavaScript with Node.js and Node modules.
  • Website development both with and without the Connect/Express web application framework.
  • Developing both HTTP server and client applications.

Who This Book Is For

This book is for anybody looking for an alternative to the "P" languages (Perl, PHP, Python), or anyone looking for a new paradigm of server-side application development. The reader should have at least a rudimentary understanding of JavaScript and web application development.

Table of Contents

Chapter 1: About Node
The capabilities of Node
Why should you use Node?
What's in a name – Node, Node.js, or Node.JS?
Chapter 2: Setting up Node
System requirements
Installing Node using package managers
Installing the StrongLoop Node distribution
Installing from source on POSIX-like systems
Installing developer tools on Mac OS X
Run a few commands; testing the commands
npm – the Node package manager
Starting Node servers at system startup
Chapter 3: Node Modules
Defining a module
Node package manager
Chapter 4: HTTP Servers and Clients – A Web Application's First Steps
Sending and receiving events with EventEmitters
HTTP server applications
HTTP Sniffer – listening to the HTTP conversation
Web application frameworks
Getting started with Express
Calculating the Fibonacci sequence with Express
Making HTTP Client requests
Calling a REST backend service from an Express application
Chapter 5: Implementing a Simple Express Application
Express and the MVC paradigm
Creating the Notes application code
Changing the look of an Express application
Scaling up and running multiple instances
Chapter 6: Data Storage and Retrieval
Asynchronizing the Notes application
Storing notes in files
Storing notes with the LevelUP data store
Storing notes in SQL – SQLite3
Storing notes the ORM way with the Sequelize module
Storing notes in MongoDB with Mongoose
Chapter 7: Multiuser Authorization, Deployment, Scaling, and Hosting
User authentication
Deploying Notes on Debian
Scaling to use all cores on multi-core servers
Deploying Notes on cloud hosting (AppFog)
Chapter 8: Dynamic Interaction between the Client and Server Application
Adding real-time web features to Notes
Introducing Socket.IO
Initializing Socket.IO with Express
Events between the Notes server and client code
Running the Notes application with Socket.IO
Sending messages between users
Chapter 9: Unit Testing
Testing asynchronous code
Assert – the simplest testing methodology
Testing a model
Testing router functions
Making it easy to run the tests

What You Will Learn

  • Discover the role of server-side JavaScript in web application development
  • Explore architecture choices in Node.js for performance and throughput
  • Install and use Node.js for both development and deployment
  • Use the Connect and Express application frameworks
  • Deploy both SQL and MongoDB database systems

In Detail

Node.js is a JavaScript platform using an event-driven, non-blocking I/O model allowing users to build fast and scalable data-intensive applications that run in real time.

This book gives you an excellent starting point and goes straight to the heart of developing web applications with Node.js. You will go from a rudimentary knowledge of JavaScript or server-side application development to being able to create and maintain your own Node.js application.

Node Web Development shows that JavaScript is not just for browsers anymore. It can be used for web application development, for developing any Internet protocol, for real-time applications, and much more. With this book you will learn through practical examples how to use the HTTP Server and client objects as well as both SQL and MongoDB databases. The book explains how application algorithms are expected to cooperate correctly with the event loop, and gives advice on algorithm refactoring for asynchronous execution through the event loop.


Read More