Getting started with hapi.js build well-structured, testable applications and APIs using hapi.js
Build well-structured, testable applications and APIs using hapi.js About This Book With the help of this book, you will improve your productivity as a developer and that of your team by focusing on business logic utilizing the structure that Hapi.js provides You will be introduced to a real-world p...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing
2016.
|
Edición: | 1st edition |
Colección: | Community experience distilled.
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009630176606719 |
Tabla de Contenidos:
- Cover; Copyright; Credits; Foreword; About the Author; About the Reviewer; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Introducing hapi.js; Node.js - a prerequisite to learning hapi.js; The hapi philosophy versus other frameworks; Building value, not infrastructure; Configuration is better than code; Separation of business logic from the transport layer; Open source and community-centric; Ecosystem; Small modules; Summarizing hapi; Creating our first hapi.js server; Installing hapi; Our first hapi server; hapi plugins; hapi configuration; The hapi style guide; Summary
- Chapter 2: Adding Functionality by Routing RequestsServer routing; Route configuration; Method; Path; Description; Validate; Pre; Handler; Cache; Route configuration summary; hapi routing algorithm; hapi request life cycle; Extending request life cycle events; hapi request object; Reply interface; Custom handlers; Serving static files with inert; Serving templates with vision; Vision configuration; Engines; Paths; compileMode; Vision summary; Summary; Chapter 3: Structuring Your Codebase with Plugins; Structuring applications; hapi plugins; Encapsulating functionality within plugins
- Plugin optionsExposing and consuming plugins; Managing plugin dependencies; Exposing sandboxed functionality; Combining plugins; The hapi plugin ecosystem; Authentication; Documentation generation; Logging; Utilities; Composing applications from plugins; Summary; Chapter 4: Adding Tests and the Importance of 100% Code Coverage; Why is the importance of testing overlooked?; The benefits and importance of testing code; Introducing hapi's testing utilities; Installing lab and code; Local versus global modules; Our first test script; Testing approaches; Testing hapi applications with lab
- Code coverageLinting; Summary; Chapter 5: Securing Applications with Authentication and Authorization; Authentication; Configuring authentication; Cookie authentication; Third-party authentication; Authentication summary; Authorization; Summary; Chapter 6: The joi of Reusable Validation; An introduction to validation; Introduction to joi; Validating hapi routes with joi; Validating route responses; Documentation generation; Summary; Chapter 7: Making Your Application Production Ready; Persisting data; MongoDB; The 'M' in MVC; Introducing caching; Server methods; Caching with server methods
- Introducing loggingDebugging applications; The console; The Node debugger; The debug mode in hapi; Profiling heapdumps; TV; Debugging summary; General production advice; Further learning; Getting started with hapi.js GitHub repo; Hapijs.com; Makemehapi; The hapi community; The hapi discussion repo; Stack Overflow; hapi Gitter channel; @hapijs on Twitter; Read the code!; Summary; Index; hapijs.com/plugins