万本电子书0元读

万本电子书0元读

顶部广告

Getting Started with hapi.js电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:John Brett

出  版  社:Packt Publishing

出版时间:2016-04-01

字       数:104.5万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
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 problem and we’ll demonstrate how to use the tools Hapi provides to resolve it This is the only book with a learn-by-example approach Who This Book Is For If you are a JavaScript developer with or without Node.js experience and would like to learn to build applications, APIs, and web servers with the best-in-class framework hapi.js, this book is perfect for you. What You Will Learn Increase your productivity by taking advantage of the out-of-the-box features hapi.js provides Build secure API servers Create websites and applications using your favorite templating language Leverage hapi.js plugins to better structure your codebase Simplify your security workflows with the built-in authentication and authorization functionality of hapi.js Ensure application reliability with testing and code coverage Reduce code complexity using reusable validation logic with joi Gather insight into your application performance via logging Start the journey to building robust production-ready applications In Detail This book will introduce hapi.js and walk you through the creation of your first working application using the out-of-the-box features hapi.js provides. Packed with real-world problems and examples, this book introduces some of the basic concepts of hapi.js and Node.js and takes you through the typical journey you'll face when developing an application. Starting with easier concepts such as routing requests, building APIs serving JSON, using templates to build websites and applications, and connecting databases, we then move on to more complex problems such as authentication, model validation, caching, and techniques for structuring your codebase to scale gracefully. You will also develop skills to ensure your application's reliability through testing, code coverage, and logging. By the end of this book, you'll be equipped with all the skills you need to build your first fully featured application. This book will be invaluable if you are investigating Node.js frameworks or planning on using hapi.js in your next project. Style and approach This book takes a step-by-step approach to building an application or web server using hapi.js though examples.
目录展开

Getting Started with hapi.js

Table of Contents

Getting Started with hapi.js

Credits

Foreword

About the Author

About the Reviewer

www.PacktPub.com

eBooks, discount offers, and more

Why subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

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

2. Adding Functionality by Routing Requests

Server 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

The reply interface

Custom handlers

Serving static files with inert

Serving templates with vision

Vision configuration

Engines

Paths

compileMode

Vision summary

Summary

3. Structuring Your Codebase with Plugins

Structuring applications

hapi plugins

Encapsulating functionality within plugins

Plugin options

Exposing 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

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 coverage

Linting

Summary

5. Securing Applications with Authentication and Authorization

Authentication

Configuring authentication

Cookie authentication

Third-party authentication

Authentication summary

Authorization

Summary

6. The joi of Reusable Validation

An introduction to validation

Introduction to joi

Validating hapi routes with joi

Validating route responses

Documentation generation

Summary

7. Making Your Application Production Ready

Persisting data

MongoDB

The 'M' in MVC

Introducing caching

Server methods

Caching with server methods

Introducing logging

Debugging 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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部