万本电子书0元读

万本电子书0元读

顶部广告

Hands-On RESTful Web Services with TypeScript 3电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:Biharck Muniz Araújo

出  版  社:Packt Publishing

出版时间:2019-03-27

字       数:38.2万

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

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

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
A step-by-step guide that will help you design, develop, scale, and deploy RESTful APIs with TypeScript 3 and Node.js Key Features * Gain in-depth knowledge of OpenAPI and Swagger to build scalable web services * Explore a variety of test frameworks and test runners such as Stryker, Mocha, and Chai * Create a pipeline by Dockerizing your environment using Travis CI, Google Cloud Platform, and GitHub Book Description In the world of web development, leveraging data is the key to developing comprehensive applications, and RESTful APIs help you to achieve this systematically. This book will guide you in designing and developing web services with the power of TypeScript 3 and Node.js. You'll design REST APIs using best practices for request handling, validation, authentication, and authorization. You'll also understand how to enhance the capabilities of your APIs with ODMs, databases, models and views, as well as asynchronous callbacks. This book will guide you in securing your environment by testing your services and initiating test automation with different testing approaches. Furthermore, you'll get to grips with developing secure, testable, and more efficient code, and be able to scale and deploy TypeScript 3 and Node.js-powered RESTful APIs on cloud platforms such as the Google Cloud Platform. Finally, the book will help you explore microservices and give you an overview of what GraphQL can allow you to do. By the end of this book, you will be able to use RESTful web services to create your APIs for mobile and web apps and other platforms. What you will learn * Explore various methods to plan your services in a scalable way * Understand how to handle different request types and the response status code * Get to grips with securing web services * Delve into error handling and logging your web services for improved debugging * Uncover the microservices architecture and GraphQL * Create automated CI/CD pipelines for release and deployment strategies Who this book is for If you’re a developer who has a basic understanding of REST concepts and want to learn how to design and develop RESTful APIs, this book is for you. Prior knowledge of TypeScript will help you make the most out of this book.
目录展开

Title Page

Copyright and Credits

Hands-On RESTful Web Services with TypeScript 3

Dedication

About Packt

Why subscribe?

Packt.com

Foreword

Contributors

About the author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

Section 1: Unraveling API Design

Introduction to RESTful API Development

Technical requirements

What is REST?

REST architectural styles

Uniform interface

Resource-based

The manipulation of resources using representations

Self-descriptive messages

HATEOAS

Stateless

Cacheable

Client-server architecture

A layered system

Code on demand

HTTP methods for RESTful services

Summary

Questions

Further reading

Principles of Designing RESTful APIs

Technical requirements

Organizing API endpoints

Resource-based APIs

Experience-based APIs

Capability-based APIs

Working with large datasets

Pagination

Sorting

Filtering

Naming conventions

Versioning

Including the version in the URL

Versioning in the subdomain

Versioning on media types

Recommendation

HTTP status codes

2xx – success

3xx – redirection

4xx – client error

5xx – server error

Summary

Questions

Further reading

Designing RESTful APIs with OpenAPI and Swagger

Technical requirements

API-first concepts

The OpenAPI Specification

Format

Document structure

Data types

Design maturity and implementation

Level 0 – The Swamp of POX

Level 1 – Resources

Level 2 – HTTP Verbs

Level 3 – Hypermedia Controls

Swagger tooling

Swagger Editor

Swagger Codegen

The Swagger UI

Summary

Questions

Further reading

Section 2: Developing RESTful Web Services

Setting Up Your Development Environment

Technical requirements

Installing various web servers

Node.js

npm

Testing Node.js and npm

Express.js

Express installation

First app with Express.js

TypeScript installation

Visual Studio Code

Code Linters

TSLint

Prettier

Testing suites

Mocha and Chai

Stryker

Debugging

Building tasks for coding

Summary

Questions

Further reading

Building Your First API

Technical requirements

Serving the app

Initial configurations and file structure

Defining and controlling basic routes

Testing with Postman

Summary

Questions

Further reading

Handling Requests and Responses

Technical requirements

Creating resource URIs

Creating models

Creating tests for the missing routes

Implementing controllers

Configuring the remaining routes

Running the application

Query strings, data filtering, and pagination

Query strings and data filtering

Pagination

Summary

Questions

Further reading

Formatting the API - Output

Technical requirements

Content negotiation

Data serialization

Hypertext Application Language

Summary

Questions

Further reading

Section 3: Enhancing RESTful Web Services

Working with Databases and ODMs

Technical requirements

Using MongoDB

Installing MongoDB

MongoDB with Docker

Installing Docker

Running MongoDB on Docker

Robomongo

Setting up order-api with Mongo

Configuring Mongoose

Creating the schemas

Changing tests

Changing the controllers

Manual testing

Summary

Questions

Further reading

Securing Your API

Technical requirements

Security overview

Using HTTPS over HTTP

Improving API security

Using bcrypt to encrypt a password

Adding authentication

Email validation

Manual testing

Summary

Questions

Further reading

Error Handling and Logging

Technical requirements

Error handling

Writing custom error handlers

Adding an error handler to order-api

Error messages

Logging

Summary

Questions

Further reading

Creating a CI/CD Pipeline for Your API

Technical requirements

Continuous Integration

Adding the code to GitHub

Continuous Integration with Travis CI

Adding tests to the pipeline

Continuous Deployment

Manual deployment to GCP

Configuring mLab

Automatic deployment to GCP

Scalability

Summary

Questions

Further reading

Section 4: Extending the Capabilities of RESTful Web Services

Developing RESTful APIs with Microservices

Technical requirements

What are microservices?

Breaking down order-api

Creating the databases

Creating the projects on GitHub

GCP projects

Swagger implementation

Create the skeleton for both microservices

The order-ms code

The user-ms code

Summary

Questions

Further reading

Flexible APIs with GraphQL

Technical requirements

Introduction to GraphQL

Configuring GraphQL with the order-ms service

Improving order-ms with order data

Connecting with MongoDB

Creating a client with Vue.js

Summary

Questions

Further reading

Assessments

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

Chapter 7

Chapter 8

Chapter 9

Chapter 10

Chapter 11

Chapter 12

Chapter 13

Other Books You May Enjoy

Leave a review - let other readers know what you think

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部