- Published 3/13/2015
- 1st Edition
Build scalable, high-traffic websites and web applications with Node.js
For many .NET programmers, Node.js represents a new way to build high-traffic websites and applications. Now there’s a practical, concise introduction to Node.js specifically for Microsoft developers. David Gaynes guides you through the entire Node.js development process. Using Microsoft Visual Studio examples, he addresses everything from setting up servers and authorization through delivering rich CSS pages packed with graphics and data-driven content. Gaynes clearly explains Node.js’s async model, coding approach, request/response paradigm, site structure, data management, security, and more. This quick guide will help you apply your hard-won .NET skills to Node.js.
Expert guidance showing you how to:
- Choose, organize, and configure the tools you need to build Node.js solutions in Visual Studio
- Apply JavaScript coding practices that help you avoid problems in Node.js
- Work with callback functions and the Node.js asynchronous programming model
- Set up a Node.js project and use what you know about MVVM and MVC patterns
- Control the entire Node.js request/response life cycle
- Establish site structure, routes, and access to static resources
- Manage data through caching, forms, IO techniques, and file uploads
- Integrate data from Microsoft SQL Server and other databases
- Use Passport to integrate simple, flexible authentication
Table of Contents
Introduction vii
Chapter 1: Setup 1
Chapter 2: JavaScript and asynchronous code 11
Working with JavaScript 12
Object-Oriented JavaScript 17
Chapter 3: Coding Node.js 21
Using the MVVM pattern 21
Writing the code 23
Chapter 4: Rendering with Node.js 31
Before you start 31
Using real data 35
Adding images and styling 37
Chapter 5: Working with site data in Node.js 39
Data from URLs 39
Data from users 42
Chapter 6: Working with external data in Node.js 47
Chapter 7: Working with file data in Node.js 57
Chapter 8: External authentication in Node.js 63
Chapter 9: Putting it all together in Node.js 71
Sockets 76
Conclusion 77
Index 79