E-Book, Englisch, 352 Seiten, eBook
Mardan Pro Express.js
1. Auflage 2014
ISBN: 978-1-4842-0037-7
Verlag: APRESS
Format: PDF
Kopierschutz: 1 - PDF Watermark
Master Express.js: The Node.js Framework For Your Web Development
E-Book, Englisch, 352 Seiten, eBook
ISBN: 978-1-4842-0037-7
Verlag: APRESS
Format: PDF
Kopierschutz: 1 - PDF Watermark
Zielgruppe
Popular/general
Autoren/Hrsg.
Weitere Infos & Material
1;Contents at a Glance;3
2;Contents;338
3;About the Author;348
4;About the Technical Reviewers;349
5;Foreword;350
6;Acknowledgments;352
7;Introduction;5
8;Part i: Getting Started;8
8.1;Chapter 1: Starting with Express.js;9
8.1.1;How Express.js Works;10
8.1.1.1;Third-Party Dependencies;11
8.1.1.2;Instantiations;11
8.1.1.3;Connecting to Databases;11
8.1.1.4;Configuring Express.js App Settings;12
8.1.1.5;Defining Middleware;12
8.1.1.6;Defining Routes;12
8.1.1.7;Starting the App;12
8.1.2;Express.js Installation;13
8.1.3;Express.js Generator In stallation;18
8.1.4;Summary;20
8.2;Chapter 2: Hello World Example;21
8.2.1;Getting Started;21
8.2.1.1;Using Request Handlers;23
8.2.1.2;Outputting Terminal Messages;23
8.2.1.3;Enhancing the App;25
8.2.2;Generator Commands;26
8.2.2.1;Generating a Skeleton Express.js app;27
8.2.2.2;Reviewing the Application’s Structure;28
8.2.2.2.1;App.js;29
8.2.3;MVC Structure and Modules;34
8.2.4;Watching for File Changes;35
8.2.5;Summary;36
9;Part II: Deep API Reference;37
9.1;Chapter 3: Configuration, Settings, and Environments;38
9.1.1;Configuration;38
9.1.1.1;app.set(?) and app.get(?);39
9.1.1.2;app.enable(?) and app.disable(?);39
9.1.1.3;app.enabled(?) and app.disabled(?);40
9.1.2;Settings;40
9.1.2.1;env;41
9.1.2.2;view cache;41
9.1.2.3;view engine;41
9.1.2.4;views;43
9.1.2.5;trust proxy;43
9.1.2.6;jsonp callback name;43
9.1.2.7;json replacer and json spaces;45
9.1.2.8;case sensitive routing;46
9.1.2.9;strict routing;47
9.1.2.10;x-powered-by;47
9.1.2.11;etag;49
9.1.2.12;query parser;50
9.1.2.13;subdomain offset;50
9.1.3;Environments;50
9.1.4;Summary;54
9.2;Chapter 4: Working with Middleware;55
9.2.1;Applying Middleware;56
9.2.2;Essential Middleware;59
9.2.2.1;compression;60
9.2.2.2;morgan;62
9.2.2.3;body-parser;63
9.2.2.4;urlencoded();64
9.2.2.5;cookie-parser;65
9.2.2.6;express-session;66
9.2.2.7;csurf;66
9.2.2.8;express.static();68
9.2.2.9;connect-timeout;68
9.2.2.10;errorhandler;70
9.2.2.11;method-override;70
9.2.2.12;response-time;71
9.2.2.13;serve-favicon;72
9.2.2.14;serve-index;73
9.2.2.15;vhost;75
9.2.2.16;connect-busboy;76
9.2.3;Other Middleware;77
9.2.4;Summary;77
9.3;Chapter 5: Template Engines and Consolidate.js;78
9.3.1;How to Use Template Engines;79
9.3.1.1;app.engine();80
9.3.1.2;Uncommon Libraries;81
9.3.2;Template Engine Choices;85
9.3.2.1;Jade;85
9.3.2.2;Haml.js;85
9.3.2.3;EJS;85
9.3.2.4;Handlebars.js;85
9.3.2.5;Hogan.js Adapters;86
9.3.2.6;Combyne.js;86
9.3.2.7;Swig;86
9.3.2.8;Whiskers;86
9.3.2.9;Blade;86
9.3.2.10;Haml-Coffee;86
9.3.2.11;Webfiller;86
9.3.3;Consolidate.js;86
9.3.4;Summary;88
9.4;Chapter 6: Parameters and Routing;89
9.4.1;Parameters;89
9.4.1.1;app.param();93
9.4.2;Routing;96
9.4.2.1;app.VERB();97
9.4.2.2;app.all();100
9.4.2.3;Trailing Slashes;100
9.4.2.4;Router Class;100
9.4.2.5;router.route(path);101
9.4.3;Request Handlers;102
9.4.4;Summary;104
9.5;Chapter 7: Express.js Request Object;105
9.5.1;request.query;106
9.5.2;request.params;108
9.5.3;request.body;110
9.5.4;request.route;112
9.5.5;request.cookies;113
9.5.6;request.signedCookies;115
9.5.7;request.header(?) and request.get(?);115
9.5.8;Other Attributes and Methods;115
9.5.9;Summary;119
9.6;Chapter 8: Express.js Response Object;120
9.6.1;response.render(?);120
9.6.2;response. locals;123
9.6.3;response.set(?);125
9.6.4;response.status(?);127
9.6.5;response.send(?);128
9.6.6;response.json(?);131
9.6.7;response.jsonp(?);133
9.6.8;response.redirect(?);134
9.6.9;Other Response Methods and Properties;134
9.6.10;Streams;138
9.6.11;Summary;140
9.7;Chapter 9: Error Handling and Running an App;141
9.7.1;Error Handling;141
9.7.2;Running an App;145
9.7.2.1;app.locals;145
9.7.2.2;app.render();145
9.7.2.3;app.mountpath;146
9.7.2.4;app.on(‘mount’, function(parent){...});147
9.7.2.5;app.path();147
9.7.2.6;app.listen();147
9.7.3;Summary;151
10;Part III: Solving Common and Abstract Problems;152
10.1;Chapter 10: Abstraction;153
10.1.1;Middleware;153
10.1.2;Routes;154
10.1.3;Combining Middleware and Routes;156
10.1.4;Summary;158
10.2;Chapter 11: Database, Keys and Stream Tips;159
10.2.1;Using Databases in Modules;159
10.2.2;Keys and Passwords;161
10.2.2.1;JSON File;162
10.2.2.2;Environment Variables;163
10.2.3;Streams;163
10.2.4;Summary;168
10.3;Chapter 12: Redis and Authentication Patterns;169
10.3.1;Redis;169
10.3.2;Authentication Patterns;173
10.3.3;Summary;174
10.4;Chapter 13: Multithreading with Clusters;175
10.4.1;A Multithreading Example;175
10.4.2;Summary;178
10.5;Chapter 14: Applying Stylus, Less, and Sass;179
10.5.1;Stylus;179
10.5.2;Less;180
10.5.3;Sass;181
10.5.4;Summary;181
10.6;Chapter 15: Security Tips;182
10.6.1;Cross-Site Request Forgery;182
10.6.2;Process Permissions;185
10.6.3;HTTP Security Headers;185
10.6.4;Input Validation;187
10.6.5;Summary;189
10.7;Chapter 16: Socket.IO and Express.js;190
10.7.1;Using Socket.IO;190
10.7.2;Running the App;194
10.7.3;Summary;195
10.8;Chapter 17: Domain and Express. js;196
10.8.1;Defining the Problem;196
10.8.2;Exploring a Basic Domain Example;197
10.8.3;Writing a Domain App;197
10.8.4;Summary;201
10.9;Chapter 18: Sails.js, DerbyJS, LoopBack, and Other Frameworks;202
10.9.1;Sails.js;202
10.9.2;DerbyJS;204
10.9.3;LoopBack;207
10.9.4;Other Frameworks;210
10.9.5;Summary;211
11;Part IV: Tutorials and Examples;212
11.1;Chapter 19: Instagram Gallery;213
11.1.1;Starting the Instagram Gallery;213
11.1.2;Viewing the Gallery;217
11.1.3;Summary;218
11.2;Chapter 20: Todo App;219
11.2.1;Overview;220
11.2.2;Setup;225
11.2.3;App.js;227
11.2.4;Routes;233
11.2.5;Jade;237
11.2.6;Less;243
11.2.7;Summary;244
11.3;Chapter 21: REST API;245
11.3.1;RESTful API Basics;246
11.3.2;Test Coverage;247
11.3.3;Dependencies;252
11.3.4;Server Implementation;253
11.3.5;Summary;257
11.4;Chapter 22: HackHall;258
11.4.1;What Is HackHall?;258
11.4.2;Running HackHall;259
11.4.3;Structure;266
11.4.4;Package. json;267
11.4.5;Express.js App;268
11.4.6;Routes;273
11.4.6.1;index. js;273
11.4.6.2;auth. js;273
11.4.6.3;main. js;278
11.4.6.4;users. js;281
11.4.6.5;application. js;287
11.4.6.6;posts. js;290
11.4.7;Mongoose Models;297
11.4.8;Mocha Tests;305
11.4.9;Summary;310
11.5;Appendix A: Related Reading and Resources;311
11.5.1;Other Node.js Frameworks;311
11.5.2;Node.js Books;313
11.5.3;JavaScript Classics;314
11.5.4;Courses;314
11.6;Appendix B: Migrating Express.js 3.x to 4.x: Middleware, Route, and Other Changes;315
11.6.1;Introducing Unbundled Middleware in Express.js 4;315
11.6.2;Removing Deprecated Methods from Express.js 4 Apps;317
11.6.2.1;app.configure();317
11.6.2.2;app.router;317
11.6.2.3;res.on(‘header’);318
11.6.2.4;res.charset;318
11.6.2.5;res.headerSent;318
11.6.2.6;req.accepted();318
11.6.3;Other Express.js 4 Changes;318
11.6.3.1;app.use();318
11.6.3.2;res.location();318
11.6.3.3;app.route();318
11.6.3.4;json spaces;319
11.6.3.5;req.params;319
11.6.3.6;res.locals;319
11.6.3.7;req.is;319
11.6.3.8;Express.js Command-Line Generator;319
11.6.4;Exploring the New Express.js 4 Route Instance and How to Chain It;319
11.6.5;Further Express.js 4 Migration Reading Links;321
11.7;Appendix C: Express.js 4 Cheat Sheet;322
11.7.1;Installation;323
11.7.2;Generator;323
11.7.3;Basics;323
11.7.4;HTTP Verbs and Routes;324
11.7.5;Request;324
11.7.6;Request Header Shortcuts;324
11.7.7;Response;325
11.7.8;Handlers Signatures;325
11.7.9;Stylus and Jade;325
11.7.10;Body;325
11.7.11;Static;326
11.7.12;Connect Middleware;326
11.7.13;Other Popular Middleware;326
11.8;Appendix D: ExpressWorks;327
11.8.1;Installation;327
11.8.2;Usage;328
11.8.3;Resetting;328
11.8.4;Tasks;328
11.8.4.1;Hello World;328
11.8.4.2;Jade;328
11.8.4.3;Good Old Form;329
11.8.4.4;Static;329
11.8.4.5;Stylish CSS;329
11.8.4.6;Param Pam Pam;329
11.8.4.7;What’s in a Query;330
11.8.4.8;JSON Me;330
11.8.5;Summary;330
12;Index;331