Express.js Guide: The Comprehensive Book on Express.jsThe Comprehensive Book on Express.js
Why Express.js is the most popular Node.js web framework yet. As of this writing (September of 2013), there are no books that are solely dedicated to it. Its official website has bits of insights for advanced Node.js programmers. However, I found that many people -- including those who go through HackReactor7 program and come to my Node.js classes at General Assembly and pariSOMA -- are interested in a comprehensive resource. The one that would cover all the different components of Express.js work together in a real production-like application. The goal of Express.js Guide is to become such resource. What This Book is Express.js Guide is a concise book on one particular library. This book contains Express.js API 3.3.58 description, the best practices on code organization and patterns, real-world examples of web apps. The topics include but not limited to middleware, command-line interface and scaffolding, ren- dering templates, extracting params from dynamic URLs, parsing payloads and cookies, managing authentication with sessions, error handling and prepping apps for production. For more details and for what exactly the book covers, please refer to the Table of Contents. What This Book is Not This book is not an introduction to Node.js, nor is it a book that covers all aspects of building a modern day web application, e.g., websockets, databases and (of course) front-end development. Keep in mind that readers also won't find in Express.js Guide a resource for learning programming and/or JavaScript fundamentals. You might want to take a look at Rapid Prototyping with JS9 for the introduction to Node.js, MongoDB and front-end development with Backbone.js. In the real-world and especially in Node.js development, due to its modularized philosophy, we seldom use just a single framework. In the book, we have tried to stick only to Express.js and leave everything else out as much as possible, without compromising the usefulness of examples. Therefore, we intentionally left out some important chunks of web developments, for example databases, authentication and testing. Although these elements are present in tutorials and examples, they're not explained in detail. For those materials, you could check books in the Related Reading and Resources section at the end of the book. Who This Book is For This book is for people fluent in programming and front-end JavaScript. In addition, to get the most benefits, readers must be familiar with basic Node.js concepts like process and global, and know core modules, including streams, clusters and buffer type. If you're thinking of starting a Node.js app, or of rewriting an existing one, and your weapon of choice is Express.js -- this guide is for you! It will answer most of your "how" and "why" questions. |
What people are saying - Write a review
We haven't found any reviews in the usual places.
Contents
II The Interface | 26 |
III Tips and Tricks | 104 |
IV Tutorials and Examples | 142 |
ExpressWorks | 260 |
Related Reading and Resources | 266 |
Migrating Expressjs 3x to 4x Middleware Route and Other Changes | 270 |
Expressjs 4 Nodejs and MongoDB REST API Tutorial | 278 |
Expressjs 4 Cheatsheet | 291 |
Common terms and phrases
__dirname admin AngelList app.get app.get('port app.js app.use(app.router app.use(express.bodyParser application assert.equal(res.status Azat Backbone.js Boolean callback checkUser configuration console.error(err console.log('Express server listening console.log(res.body cookies core Node.js create CSRF CURL database default delete end(function(e error example expect(e).to.eql(null express Express.js 4.x Express.js app Express.js Guide expressworks Facebook false favicon folder framework front-end function function(done function(err function(req GitHub HackHall header index.js Jade JavaScript JSON listening on port logging Mardan method middleware Mocha module MongoDB Mongoose Mongoskin next(err node npm install null OAuth obj._id object options package.json param parameter password path process.env.PORT query query string Rapid Prototyping Redis regexp req.body req.db.Post.find req.session.userId request handler require('express require('http res.send REST API server return next(e return next(error return next(new routes Ruby on Rails session source code String tasks template engine test-driven development there’s true tutorial update username
