If you know how to use javascript in the browser, you already have the skills you need to put javascript to work on back-end servers with Node. This hands-on book shows you how to use this popular javascript platform to create simple server applications, communicate with the client, build dynamic pages, work with data, and tackle other tasks.
Although Node has a complete library of developer-contributed modules to automate server-side development, this book will show you how to program with Node on your own, so you truly understand the platform. Discover firsthand how well Node works as a web server, and how easy it is to learn and use.
Set up Node and learn how to build scaffolding for a web application
Work with Node natively to see how it functions as a web server
Understand how Node receives client data from GET and POST requests
Use the Socket.IO module to facilitate realtime client-server communication
Choose from among several Node templates to create dynamic pages
Learn how to connect to a database, and store data in files
Implement the Model-View-Controller pattern, and share Node modules with server and client
Author(s): Garann Means
Publisher: O'Reilly Media
Year: 2012
Language: English
Pages: 58
City: Sebastopol, CA
Tags: Библиотека;Компьютерная литература;Node.js;
Table of Contents......Page 5
Preface......Page 7
Safari® Books Online......Page 9
How to Contact Us......Page 10
Node and NPM......Page 11
REPL......Page 12
File Organization......Page 13
Writing a Response Manually......Page 15
Serving a Static Page......Page 16
Serving Client-Side Assets......Page 18
Adding In Middleware......Page 20
Receiving Data from the Querystring......Page 23
Routing and Receiving Data from a Path......Page 24
Receiving Data from a POST......Page 25
Responding to Asynchronous Requests......Page 26
Real-Time Communication......Page 27
Creating a Dynamic Page......Page 31
Partial Templates......Page 34
Parsing Other File Types......Page 36
Creating Files on the Fly......Page 37
Connecting to a Database......Page 39
Storing Data in Files......Page 42
Callbacks and Messaging......Page 43
Implementing the MVC Pattern......Page 47
Out-of-the-Box MVC......Page 52
Sharing Modules Between the Client and Server......Page 53
Postscript......Page 55