Cargando…

Express.js blueprints : learn to use Express.js pragmatically by creating five fun and robust real-world APIs, with a bonus chapter on Koa.js /

This book is for beginners to Node.js and also for those who are technically advanced. By the end of this book, every competent developer will have achieved expertise in building web applications with Express.js.

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Augarten, Ben (Autor)
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham : Packt Publishing, 2015.
Colección:Community experience distilled.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Copyright; Credits; About the Authors; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Building a Basic Express Site; Setting up Express for a static site; Saying Hello, World in Express; Jade templating; Local user authentication; User object modeling; Introducing Express middleware; Setting up passport; Registering users; Authenticating users; OAuth with passport; Adding OAuth to user model; Getting API tokens; Third-party registration and login; Profile pages; URL params; Profile templates; Testing; Introducing Mocha; Testing API endpoints
  • Automate builds and deploysIntroducing the Gruntfile; Continuous integration with Travis; Deploying Node.js applications; Summary; Chapter 2: A Robust Movie API; Folder structure and organization; Responding to CRUD operations; Retrieving an actor with GET; Creating a new actor with POST; Updating an actor with PUT; Removing an actor with DELETE; Object modeling with Mongoose; Generating unique IDs; Validating your database; Extracting functions to reusable middleware; Testing; Summary; Chapter 3: Multiplayer Game API
  • Connect 4; Modeling Game State with Mongoose; Creating a new game
  • Input validationGetting the game state; Joining a game; Playing the game; Testing for a tie; Summary; Chapter 4: MMO Word Game; Gameplay; Real-time application overview; Keeping track of active users; Schema design; User schema; User join; Promises; The then and catch method; Chain multiple Promises; Prevent duplicates; User leaves the game; Show all active users; The words
  • Subdocuments; Validate input; Dealing with race conditions; Test case to test race conditions; Socket. IO; Socket handshaking, user join; Adding and pushing updates to clients; Launch Socket. IO applications
  • Test Socket. IO applications with the Socket. IO clientDebug Socket. IO with Chrome Developer Tools; Summary; Chapter 5: Coffee with Strangers; Code structure; Defining routes; Persisting data; Exception handling; Naive pairing; Notes about tests; Considering user history; Optimizing for distance; E-mail follow up; Periodical tasks with node-cron; Summary; Chapter 6: Hacker News API on Koa.js; Generator syntax; Middleware philosophy; Context versus req, res; The link model; The link routes; Tying it together; Validation and error handling; Update route; Let's perform some tests; Parallel requests
  • Rendering HTML pagesServing static assets; Summary; Appendix: Connect 4
  • Game Logic; Index